-
Notifications
You must be signed in to change notification settings - Fork 985
Description
Hello guys, We wanted to use https://github.com/GoogleChrome/web-vitals#browser-support to get some metrics from our browser instrumentation and send them through opentelemetry-js. In order to accomplish that we started to make some tests with the examples provided here.
What version of OpenTelemetry are you using?
I'm using 0.27.0 opentelemetry-js version (this repo in main branch) and otelcontribcol 0.40.0
What version of Node are you using?
v12.16.3
Please provide the code you used to setup the OpenTelemetry SDK
At the moment the exporter does not work with the examples provided.
Just changed this in the example (tracer-web/metrics/index.js)
const labels = { pid: 1, environment: 'staging' }; because 'process' is undefined
What did you do?
We just simply start up the 'tracer-web' examples.
All the traces examples work as expected and arrive to our collector, but metrics doesn't.
If possible, provide a recipe for reproducing the error.
- Have your collector running
- cd opentelemetry-js/examples/tracer-web
- npm install
- in metrics/index.js change:
const labels = { pid: process.pid, environment: 'staging' };toconst labels = { pid: 1, environment: 'staging' }; - npm run start
- Go to http://localhost:8090/metrics/ and click 'Start metrics'
What did you expect to see?
I expected to see the metrics in our collector/backed, like all the other traces examples that works correctly.
What did you see instead?
In Network tab from the browser I have a 400 Bad request response from the collector.
{"code":3,"message":"unknown field \"doubleSum\" in v1.Metric"}
Additional context
-
traces are exported to localhost:55681/v1/traces (default legacy endpoint)
-
metrics are exported to localhost:55681/v1/metrics (default legacy endpoint)
-
Docker compose collector file:
version: "2"
services:
# Collector
otel-collector:
image: otel/opentelemetry-collector-contrib:0.40.0
command: ["--config=/etc/otel-collector-local-config.yaml"]
volumes:
- ./otel-collector-local-config.yaml:/etc/otel-collector-local-config.yaml
- /home/fernando/workspace/khoros/agent/collector-volume:/etc/collector-logging/
environment:
LOG_EXPORTER_LOG_LEVEL: "DEBUG"
NEW_RELIC_API_KEY: "key123"
ports:
- "1888:1888" # pprof extension
- "13133:13133" # health_check extension
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP HTTP receiver
- "55681:55681" # default legacy OTLP HTTP receiver
- "55670:55679" # zpages extension
- "8888:8888" # Prometheus metrics exposed by the collector
- "8889:8889" # Prometheus exporter metrics
- Collector yml config file:
receivers:
otlp:
protocols:
grpc:
http:
cors_allowed_origins:
- http://*
- https://*
exporters:
logging:
logLevel: $LOG_EXPORTER_LOG_LEVEL
otlp:
endpoint: https://otlp.nr-data.net:4317
headers:
"api-key": $NEW_RELIC_API_KEY
processors:
batch:
extensions:
health_check: {}
service:
extensions: [health_check]
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [otlp, logging]
metrics:
receivers: [otlp]
exporters: [otlp, logging]
Hope the information is enough to reproduce the issue, if not, please reach me and I provide more details.