graphql-engine/server
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
..
benchmarks Fix #9447 bad memory usage 2023-07-25 11:24:57 +00:00
documentation chore(server): delete MySQL native backend 2023-05-05 10:32:56 +00:00
forks/hedis chore(tooling): import ekg-prometheus into the monorepo 2023-06-27 18:37:11 +00:00
lib Enable inherited role redaction tests for Citus and Cockroach and fix DISTINCT ON for Cockroach 2023-07-26 04:50:25 +00:00
src-emit-metadata-openapi harmonize network manager handling 2023-02-22 15:55:54 +00:00
src-exec Log Postgres Source Names in Connection Errors 2023-07-20 11:20:09 +00:00
src-lib INFRA-833: OpenTelemetry exporter for metrics 2023-07-26 05:22:17 +00:00
src-rsr ci: tag release v2.30.1 2023-07-21 12:46:33 +00:00
src-test server: null forwarding feature flag 2023-07-21 15:12:32 +00:00
test-manual server/test-manual: A way to start PostgreSQL with a read replica. 2023-03-28 09:20:51 +00:00
test-mssql Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
test-postgres server: null forwarding feature flag 2023-07-21 15:12:32 +00:00
tests-py server: add tests for invalid auth when using graphql-ws protocol 2023-07-20 10:44:47 +00:00
.dockerignore update packages (#251) 2018-08-08 13:10:13 +05:30
.gitignore server: Clean up Cabal project files 2022-04-07 07:16:12 +00:00
.ormolu Upgrade Ormolu to v0.5. 2022-11-02 20:55:13 +00:00
commit_diff.txt Rewrite GraphQL schema generation and query parsing (close #2801) (#4111) 2020-08-21 12:27:01 -05:00
COMPILING-ON-MACOS.md Upgrade cabal version used in CI server-build 2023-06-08 08:32:15 +00:00
CONTRIBUTING.md Upgrade cabal version used in CI server-build 2023-06-08 08:32:15 +00:00
graphql-engine.cabal Fix #9447 bad memory usage 2023-07-25 11:24:57 +00:00
Makefile ci: misc. cleanup, naming 2022-01-03 06:26:39 +00:00
STYLE.md Nix: Use nixpkgs-fmt to format everything. 2022-06-20 13:02:45 +00:00
testing-guidelines.md Extract the test harness from the Hspec tests 2022-10-04 08:31:26 +00:00
troubleshooting.md Create troubleshooting.md 2022-05-30 09:18:44 +00:00
VERSIONS.json server: Upgrade the HGE server to GHC 9.4.5 2023-06-06 13:29:30 +00:00