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

ClickHouse - ScopeAttributes aren't stored #27425

Closed
StarpTech opened this issue Oct 4, 2023 · 17 comments
Closed

ClickHouse - ScopeAttributes aren't stored #27425

StarpTech opened this issue Oct 4, 2023 · 17 comments

Comments

@StarpTech
Copy link
Contributor

StarpTech commented Oct 4, 2023

Component(s)

No response

What happened?

Description

Hi, I found out that scope attributes attached to a Meter aren't forwarded to ClickHouse. It seems, they aren't passed here https://github.com/wundergraph/opentelemetry-collector-contrib/blob/dbb685a63b0527c1255663e11daba27ca94e60dc/exporter/clickhouseexporter/internal/histogram_metrics.go#L178

Steps to Reproduce

Create a meter with the following option and measure anything.

routerMeter := h.meterProvider.Meter(cosmoRouterMeterName,
	metric.WithInstrumentationVersion("0.0.1"),
	metric.WithInstrumentationAttributes(attribute.String("router.version", "0.0.1")),
)

Expected Result

I should see attributes in the ScopeAttributes column.

Actual Result

No attributes.

Collector version

0.84.0

Environment information

Environment

OS: (e.g., "Ubuntu 20.04") Pop!_OS 22.04 LTS x86_64
Compiler(if manually compiled): (e.g., "go 14.2") go version go1.20.4 linux/amd64

OpenTelemetry Collector configuration

receivers:
  otlp:
    protocols:
      http:
        endpoint: '0.0.0.0:4318'

exporters:
  clickhouse:
    endpoint: ${CLICKHOUSE_ENDPOINT}
    timeout: 10s
    database: cosmo
    traces_table_name: otel_traces
    metrics_table_name: otel_metrics
    ttl_days: 30
    sending_queue:
      queue_size: 5000
    retry_on_failure:
      enabled: true
      initial_interval: 10s
      max_interval: 30s
      max_elapsed_time: 300s

service:
  pipelines:
    metrics:
      receivers: [otlp]
      exporters: [clickhouse]
    traces:
      receivers: [otlp]
      exporters: [clickhouse]

Log output

No response

Additional context

No response

@StarpTech StarpTech added bug Something isn't working needs triage New item requiring triage labels Oct 4, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

Pinging code owners for exporter/clickhouse: @hanjm @dmitryax @Frapschen. See Adding Labels via Comments if you do not have permissions to add labels yourself.

@crobert-1
Copy link
Member

crobert-1 commented Oct 5, 2023

I don't have much context here, but it looks like the scope attributes are actually getting passed in where you've referenced. The scopeInstr variable is the instrumentation scope, which includes a getter method Attributes() (the scope instrumentation attributes). From the flow of metrics in this exporter, it looks like after all the histogram metrics are all added to a list together, they get inserted into Clickhouse using the insert method. From here we find the instrumentation scope attributes are converted into a key-value pair map, and then theoretically inserted into the DB using the SQL command. The SQL insert command being executed is found here.

I'll have to defer to code owners to confirm what I've found. They might have some more context as to why things are different than expected here.

@cwegener
Copy link
Contributor

@StarpTech Can you make the collector config shorter, so that it is easier for others to reproduce?

@StarpTech
Copy link
Contributor Author

Done

@Frapschen Frapschen removed the needs triage New item requiring triage label Oct 16, 2023
@Frapschen
Copy link
Contributor

@StarpTech Does this issue still remain or should I close it?

@StarpTech
Copy link
Contributor Author

Hi, I can still reproduce it.

Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Dec 18, 2023
@crobert-1 crobert-1 removed the Stale label Dec 18, 2023
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Feb 19, 2024
@StarpTech
Copy link
Contributor Author

@Frapschen Can the code owners provide any feedback?

@github-actions github-actions bot removed the Stale label Feb 20, 2024
@Frapschen
Copy link
Contributor

@StarpTech
Copy link
Contributor Author

I'll try to reproduce it again and come back.

Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@SpencerTorres
Copy link
Member

Hey @StarpTech! Were you able to reproduce this?

Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Aug 26, 2024
@SpencerTorres
Copy link
Member

@StarpTech let me know if this is still an issue. Thanks!

@github-actions github-actions bot removed the Stale label Aug 27, 2024
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Oct 28, 2024
Copy link
Contributor

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants