graphql-engine/server/src-lib/Hasura
Brandon Simmons f0441a3d61 INFRA-833: OpenTelemetry exporter for metrics
I scratched out some changes to support this in the front end, mostly to test it easily,   maybe this can be used without much rework (validation seems to work correctly, but the tests need to be extended and probably fixed):

<img width="648" alt="fd" src="https://github.com/hasura/graphql-engine-mono/assets/68095256/e5873a90-ef83-43c3-9d54-cfc0a693baca">

-------

## Fake OTel collector for testing

ChatGPT spit this out, and it's what I used to test, if it's useful to others:

``` python
from flask import Flask, request
from opentelemetry.proto.collector.trace.v1.trace_service_pb2 import ExportTraceServiceRequest
from opentelemetry.proto.collector.metrics.v1.metrics_service_pb2 import ExportMetricsServiceRequest
import google.protobuf.json_format as json_format

app = Flask(__name__)

@app.route("/v1/traces", methods=["POST"])
def handle_traces():
    if request.method == 'POST':
        binary_trace = request.get_data()
        trace_request = ExportTraceServiceRequest()
        trace_request.ParseFromString(binary_trace)
        print("Received trace data:\n")
        print(json_format.MessageToJson(trace_request, indent=2, preserving_proto_field_name=True))
        return "Trace data received", 200

@app.route("/v1/metrics", methods=["POST"])
def handle_metrics():
    if request.method == 'POST':
        binary_metric = request.get_data()
        metric_request = ExportMetricsServiceRequest()
        metric_request.ParseFromString(binary_metric)
        print("Received metrics data:\n")
        print(json_format.MessageToJson(metric_request, indent=2, preserving_proto_field_name=True))
        return "Metrics data received", 200

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=8080)
```

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9552
Co-authored-by: Puru Gupta <32328846+purugupta99@users.noreply.github.com>
Co-authored-by: Toan Nguyen  <1615675+hgiasac@users.noreply.github.com>
Co-authored-by: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com>
Co-authored-by: Daniele Cammareri <5709409+dancamma@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Rob Dominguez <24390149+robertjdominguez@users.noreply.github.com>
GitOrigin-RevId: f340bfc5c135a7bb24735b524d015e05db422fd2
2023-07-26 05:22:17 +00:00
..
App server: null forwarding feature flag 2023-07-21 15:12:32 +00:00
Backends Enable inherited role redaction tests for Citus and Cockroach and fix DISTINCT ON for Cockroach 2023-07-26 04:50:25 +00:00
Cache server, pro: actually reformat the code-base using ormolu 2021-09-23 22:57:37 +00:00
Eventing server: add log line for Event Trigger timeout errors 2023-07-13 09:53:27 +00:00
Function server: collect remote schema and database introspections while building schema cache 2023-06-01 16:34:31 +00:00
GraphQL chore(server): permissions for inline logical models 2023-07-25 10:11:35 +00:00
LogicalModel chore(server): permissions for inline logical models 2023-07-25 10:11:35 +00:00
LogicalModelResolver chore(server): permissions for inline logical models 2023-07-25 10:11:35 +00:00
Metadata server: collect remote schema and database introspections while building schema cache 2023-06-01 16:34:31 +00:00
NativeQuery chore(server): permissions for inline logical models 2023-07-25 10:11:35 +00:00
QueryTags Remove the last of the obvious Aeson TemplateHaskell 2023-06-28 15:45:09 +00:00
RemoteSchema server/schema-registry: fix metadata resource version -1 for catalog sync 2023-07-17 08:12:31 +00:00
RQL INFRA-833: OpenTelemetry exporter for metrics 2023-07-26 05:22:17 +00:00
Server server: null forwarding feature flag 2023-07-21 15:12:32 +00:00
Services Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
SQL Remove some TemplateHaskell from Hasura.SQL 2023-06-29 10:32:19 +00:00
StoredProcedure chore(server): tidy logimo permissions 2023-07-12 10:45:42 +00:00
Table Refactor inherited roles data redaction types 2023-07-18 13:50:32 +00:00
Tracing Add additional tracing spans to HGE GraphQL queries and the Super Connector 2023-05-31 05:49:12 +00:00
App.hs server: null forwarding feature flag 2023-07-21 15:12:32 +00:00
ClientCredentials.hs Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
CredentialCache.hs server: Make HLint pass, by hook or by crook. 2023-04-25 14:03:02 +00:00
GC.hs server: use lighter GC in ourIdleGC when idle 2023-07-12 09:26:11 +00:00
HTTP.hs Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
Logging.hs Remove the last of the obvious Aeson TemplateHaskell 2023-06-28 15:45:09 +00:00
Name.hs feat(server): native Postgres array support 2023-06-28 08:47:59 +00:00
PingSources.hs Fix: Unable to use environment variable for CockroachDB connection string in Cloud 2023-02-14 12:15:58 +00:00
QueryTags.hs Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
Services.hs harmonize network manager handling 2023-02-22 15:55:54 +00:00
Session.hs Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
ShutdownLatch.hs multitenant: make shutdown logic more abstract 2022-11-23 07:53:19 +00:00
Tracing.hs PLAT-438: improve traces from OpenTelemetry 2023-04-26 16:21:29 +00:00