mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 09:22:43 +03:00
f0441a3d61
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 |
||
---|---|---|
.. | ||
legacy-ce | ||
legacy-ee |