Slackbot
03/16/2023, 11:14 PMSean
03/17/2023, 7:00 AMEric Riddoch
03/17/2023, 6:55 PMversion: "3.8"
services:
bento-service:
image: dummy-service:latest
ports:
- "3000:3000"
volumes:
- .:/home/bentoml/bento/src/
- ./bentoml_configuration.yaml:/home/bentoml/bentoml_configuration.yaml
command: serve --port 3000 --debug # have tried with --production as well
environment:
OTEL_EXPORTER_OTLP_ENDPOINT: <https://otlp.nr-data.net>
# I've tried enabling/disabling this
OTEL_EXPORTER_OTLP_HEADERS: api-key=${NEW_RELIC_LICENSE_KEY},service.name=opentelemetry-bento-svc
BENTO_CONFIG: /home/bentoml/bentoml_configuration.yaml
env_file:
- .env
And here's my bentoml_configuration.yaml
version: 1
api_server:
tracing:
enabled: true
exporter_type: otlp
sample_rate: 1.0
otlp:
protocol: grpc
endpoint: <https://otlp.nr-data.net>
grpc:
insecure: false
headers:
- ["grpc-encoding", "gzip"]
- ["api-key", "${NEW_RELIC_LICENSE_KEY}"]
- ["service.name", "opentelemetry-bento-svc"]
But when I run docker-compose up
, bentoml gives me this warning
[DEBUG] [dev_api_server] 'tracing.sample_rate' is set to zero. No traces will be collected. Please refer to <https://docs.bentoml.org/en/latest/guides/tracing.html> for more details.
Why wouldn't bento be respecting my bento_configuration.yaml
?Eric Riddoch
03/17/2023, 7:06 PM.
βββ bentofile.yaml
βββ bentoml_configuration.yaml
βββ docker-compose.yml
βββ service.py
Jim Rohrer
03/17/2023, 7:18 PMBENTOML_CONFIG
Jim Rohrer
03/17/2023, 7:19 PMBENTO_CONFIG
Eric Riddoch
03/17/2023, 7:20 PMJim Rohrer
03/17/2023, 7:21 PMbentofile.yaml
, under the docker.env
key: https://docs.bentoml.org/en/latest/concepts/bento.html#docker-optionsEric Riddoch
03/17/2023, 7:21 PMEric Riddoch
03/17/2023, 7:52 PMFailed to export traces, error code: StatusCode.PERMISSION_DENIED
And when I remove the API key altogether, I get
Failed to export traces, error code: StatusCode.UNAUTHENTICATED
This would seem to indicate that my API key is valid, but somehow doesn't have permission to push traces to NewRelic. I think it's a license key. Any idea how I might troubleshoot this?
This key is of type LICENSE
Jim Rohrer
03/17/2023, 7:58 PMJim Rohrer
03/17/2023, 7:59 PMEric Riddoch
03/17/2023, 7:59 PMJim Rohrer
03/17/2023, 7:59 PMEric Riddoch
03/17/2023, 8:07 PMdummy-service-bento-service-1 | 2023-03-17T20:06:44+0000 [INFO] [dev_api_server] 172.22.0.1:59704 - "POST /predict HTTP/1.1" 200 (trace=e7fde7960a744d368c34896b26d3544c,span=1b911bcd8e57b82d,sampled=1)
dummy-service-bento-service-1 | 2023-03-17T20:06:44+0000 [INFO] [dev_api_server] 172.22.0.1:59704 (scheme=http,method=POST,path=/predict,type=application/json,length=16) (status=200,type=application/json,length=25) 2068.939ms (trace=e7fde7960a744d368c34896b26d3544c,span=0387ffb4f6eb1d1c,sampled=1)
dummy-service-bento-service-1 | I0317 20:06:44.237912919 39 <http://socket_utils_common_posix.cc:407]|socket_utils_common_posix.cc:407]> Disabling AF_INET6 sockets because ::1 is not available.
dummy-service-bento-service-1 | 2023-03-17T20:06:44+0000 [ERROR] [dev_api_server] Failed to export traces, error code: StatusCode.PERMISSION_DENIED
Eric Riddoch
03/17/2023, 8:30 PMEric Riddoch
03/17/2023, 8:38 PMEric Riddoch
04/03/2023, 9:49 PMHello,
Thanks for your patience.
I went over this with our engineers within the OTEL space and unfortunately they are not familiar enough with the BentoML product to advise on how to resolve this. The issue doesn't appear to be related to the license key being invalid, since it was failing with the permission denied message for me as well. The team suggested filing an issue with BentoML as the next step, and letting them know that there is an issue with sending data when authentication is required.
I'm sorry I don't have better news.I opened this up as a GitHub issue here
Eric Riddoch
04/03/2023, 9:51 PMotel-config.yml
receivers:
otlp:
protocols:
grpc:
http:
prometheus:
config:
scrape_configs:
- job_name: bentoml-otel-prom-job
static_configs:
- targets: ["${SCRAPE_TARGET}"]
metrics_path: /metrics
scrape_interval: 5s
processors:
batch:
exporters:
otlp:
endpoint: ${OTEL_EXPORTER_OTLP_ENDPOINT}
headers:
api-key: ${NEW_RELIC_LICENSE_KEY}
service:
telemetry:
logs:
level: "debug"
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [otlp]
metrics:
receivers: [otlp, prometheus]
processors: [batch]
exporters: [otlp]
logs:
receivers: [otlp]
processors: [batch]
exporters: [otlp]
NRQL statement:
FROM Log, Metric, Span SELECT count(*) WHERE instrumentation.provider = 'opentelemetry' and newrelic.source = 'api.metrics.otlp' facet entity.name , service.name , newrelic.source since 30 days ago](<FROM Log, Metric, Span SELECT count(*) WHERE instrumentation.provider = 'opentelemetry' and newrelic.source = 'api.metrics.otlp' facet entity.name , `entity.guid`, service.name , newrelic.source since 30 days ago
Result:Eric Riddoch
04/03/2023, 9:52 PMEric Riddoch
04/03/2023, 9:54 PMotel-collector
and the BentoML service are using the same New Relic license key to.
The OtelCollector is pushing metrics directly to NewRelic.
The BentoML app is pushing traces directly to NewRelic. (wouldn't be against pushing them directly to the collector)
This leads me to believe that the error is due to a configuration issue with my BentoML app or with a bug in the BentoML codebase.