Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collector-exporter-node example is not working, no metrics are exposed #1587

Closed
TheAvalanche opened this issue Oct 9, 2020 · 3 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@TheAvalanche
Copy link

Please answer these questions before submitting a bug report.

What version of OpenTelemetry are you using?

0.11.0

What version of Node are you using?

v12.18.2

Please provide the code you used to setup the OpenTelemetry SDK

opentelemetry-js\examples\collector-exporter-node (current git version ae1185dbcdc41d666f7e9f47474ea8996dbc8968)

What did you do?

Followed the instruction in README.md

npm install
npm run docker:start
npm run start:metrics

What did you expect to see?

Metrics to be visible at http://localhost:9464/metrics

What did you see instead?

The response is HTTP 200, but no metrics are exposed.
I see, that metrics are sent from metrics.js. If I apply logging exporter to collector-config.yaml, I see that metrics are received, but the data looks a bit weird.
Sent from metrics.js:

items to be sent [
  {
    descriptor: {
      name: 'requests',
      description: 'Example of a Counter',
      unit: '1',
      metricKind: 0,
      valueType: 1
    },
    labels: { pid: 3760, environment: 'staging' },
    aggregator: SumAggregator { kind: 0, _current: 7, _lastUpdateTime: [Array] },
    resource: Resource { attributes: [Object] },
    instrumentationLibrary: { name: 'example-exporter-collector', version: '*' }
  }....

Logged in collector:

collector_1          | Resource labels:
collector_1          |      -> service.name: STRING(basic-metric-service)
collector_1          |      -> telemetry.sdk.language: STRING(nodejs)
collector_1          |      -> telemetry.sdk.name: STRING(opentelemetry)
collector_1          |      -> telemetry.sdk.version: STRING(0.11.0)
collector_1          | InstrumentationLibraryMetrics #0
collector_1          | InstrumentationLibrary example-exporter-collector *
collector_1          | Metric #0
collector_1          | Descriptor:
collector_1          |      -> Name:
collector_1          |      -> Description:
collector_1          |      -> Unit:
collector_1          |      -> DataType: None
...

No errors, but descriptor details are missing and no metrics info. Maybe this is ok, but still nothing is exposed over http://localhost:9464/metrics

@TheAvalanche TheAvalanche added the bug Something isn't working label Oct 9, 2020
@obecny obecny self-assigned this Oct 9, 2020
@obecny
Copy link
Member

obecny commented Oct 9, 2020

I guess you are probably using the latest docker with collector 0.12 which is using proto ver. 0.5.0. If that is the case then you can either use ver 0.6 of collector or wait until this is going to be reviewed, merged and released -> #1588

@BrynCooke
Copy link

BrynCooke commented Jun 1, 2021

I think there may still be an issue.
Using:

  • @opentelemetry/exporter-collector-*: "^0.19.0"
  • otel/opentelemetry-collector:0.27.0
  • prom/prometheus:v2.27.1

Neither of the counters expose metrics. However, the value recorder does work.

# HELP test_value_recorder Example of a ValueRecorder
# TYPE test_value_recorder histogram
test_value_recorder_bucket{environment="staging",pid="91681",le="+Inf"} 13
test_value_recorder_sum{environment="staging",pid="91681"} 5.192049108940445
test_value_recorder_count{environment="staging",pid="91681"} 13

Switching to PrometheusExporter give all the metrics:

# HELP requests Example of a Counter
# TYPE requests counter
requests{pid="102893",environment="staging"} 2 1622577824543
# HELP test_up_down_counter Example of a UpDownCounter
# TYPE test_up_down_counter gauge
test_up_down_counter{pid="102893",environment="staging"} 0 1622577824543
# HELP test_value_recorder Example of a ValueRecorder
# TYPE test_value_recorder histogram
test_value_recorder_count{pid="102893",environment="staging"} 2 1622577824543
test_value_recorder_sum{pid="102893",environment="staging"} 0.6842843667376255 1622577824543
test_value_recorder_bucket{pid="102893",environment="staging",le="+Inf"} 2 1622577824543

Counters using opentelementry-rust-otlp seem to work just fine.

@dyladan
Copy link
Member

dyladan commented Aug 3, 2022

This is the old SDK with old examples. Everything has been changed since this issue

@dyladan dyladan closed this as completed Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants