diff --git a/examples/metrics.protobuf-bin b/examples/metrics.protobuf-bin new file mode 100644 index 000000000..c821ceb76 Binary files /dev/null and b/examples/metrics.protobuf-bin differ diff --git a/examples/metrics.protobuf-text b/examples/metrics.protobuf-text new file mode 100644 index 000000000..8d41d58cf --- /dev/null +++ b/examples/metrics.protobuf-text @@ -0,0 +1,112 @@ +# proto-file: opentelemetry/proto/collector/metrics/v1/trace_service.proto +# proto-message: ExportMetricsServiceRequest +# this message can be compiled to a binary message file with: +# cat examples/metrics.protobuf-text | protoc --encode=opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest opentelemetry/proto/collector/metrics/v1/metrics_service.proto > examples/metrics.protobuf-bin +# and then delivered via cURL with: +# curl -X POST --data-binary @metrics.protobuf-bin -H "Content-Type: application/x-protobuf" localhost:4318/opentelemetry.proto.collector.metrics.v1.MetricsService/Export + +resource_metrics: [ + { + resource: { + attributes: [ + { + key: "service.name", + value: { + string_value: "my.service" + } + } + ] + }, + scope_metrics: [ + { + scope: { + name: "my.library", + version: "1.0.0", + attributes: [ + { + key: "my.scope.attribute", + value: { + string_value: "some scope attribute" + } + } + ] + }, + metrics: [ + { + name: "my.counter", + unit: "1", + description: "I am a Counter", + sum: { + aggregation_temporality: 1, + is_monotonic: true, + data_points: [ + { + as_double: 5, + start_time_unix_nano: 1544712660300000000, + time_unix_nano: 1544712660300000000, + attributes: [ + { + key: "my.counter.attr", + value: { + string_value: "some value" + } + } + ] + } + ] + } + }, + { + name: "my.gauge", + unit: "1", + description: "I am a Gauge", + gauge: { + data_points: [ + { + as_double: 10, + time_unix_nano: 1544712660300000000, + attributes: [ + { + key: "my.gauge.attr", + value: { + string_value: "some value" + } + } + ] + } + ] + } + }, + { + name: "my.histogram", + unit: "1", + description: "I am a Histogram", + histogram: { + aggregation_temporality: 1, + data_points: [ + { + start_time_unix_nano: 1544712660300000000, + time_unix_nano: 1544712660300000000, + count: 2, + sum: 2, + bucket_counts: [1,1], + explicit_bounds: [1], + min: 0, + max: 2, + attributes: [ + { + key: "my.histogram.attr", + value: { + string_value: "some value" + } + } + ] + } + ] + } + } + ] + } + ] + } +] diff --git a/examples/trace.protobuf-bin b/examples/trace.protobuf-bin new file mode 100644 index 000000000..c646a99d6 Binary files /dev/null and b/examples/trace.protobuf-bin differ diff --git a/examples/trace.protobuf-text b/examples/trace.protobuf-text new file mode 100644 index 000000000..ffbfb458b --- /dev/null +++ b/examples/trace.protobuf-text @@ -0,0 +1,56 @@ +# proto-file: opentelemetry/proto/collector/trace/v1/trace_service.proto +# proto-message: ExportTraceServiceRequest +# this message can be compiled to a binary message file with: +# cat examples/trace.protobuf-text | protoc --encode=opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest opentelemetry/proto/collector/trace/v1/trace_service.proto > examples/trace.protobuf-bin +# and then delivered via cURL with: +# curl -X POST --data-binary @trace.protobuf-bin -H "Content-Type: application/x-protobuf" localhost:4318/opentelemetry.proto.collector.trace.v1.TraceService/Export + +resource_spans: [ + { + resource: { + attributes: [ + { + key: "service.name", + value: { + string_value: "my.service" + } + } + ] + }, + scope_spans: [ + { + scope: { + name: "my.library", + version: "1.0.0", + attributes: [ + { + key: "my.scope.attribute", + value: { + string_value: "some scope attribute" + } + } + ] + }, + spans: [ + { + trace_id: "\x5B\x8E\xFF\xF7\x98\x03\x81\x03\xD2\x69\xB6\x33\x81\x3F\xC6\x0C", + span_id: "\xEE\xE1\x9B\x7E\xC3\xC1\xB1\x74", + parent_span_id: "\xEE\xE1\x9B\x7E\xC3\xC1\xB1\x73", + name: "I'm a server span", + start_time_unix_nano: 1544712660000000000, + end_time_unix_nano: 1544712661000000000, + kind: 2, + attributes: [ + { + key: "my.span.attr", + value: { + string_value: "some value" + } + } + ] + } + ] + } + ] + } +] \ No newline at end of file