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

[exporter/clickhouse] Add ScopeName ScopeVersion in span table #21919

Merged
merged 2 commits into from
Jun 21, 2023

Conversation

Frapschen
Copy link
Contributor

resolve: #21214

@Frapschen
Copy link
Contributor Author

In my local dev, the result look like:

6b3a9cffef01 :) select * from otel_traces FORMAT JSON

SELECT *
FROM otel_traces
FORMAT JSON

Query id: e782c843-03e3-4db8-a238-7bb4b813fbbd

{
        ...
        "data":
        [
                {
                        "Timestamp": "2023-05-15 08:37:07.987827000",
                        "TraceId": "",
                        "SpanId": "",
                        "ParentSpanId": "",
                        "TraceState": "",
                        "SpanName": "",
                        "SpanKind": "SPAN_KIND_UNSPECIFIED",
                        "ServiceName": "test-service",
                        "ResourceAttributes": {"service.name":"test-service"},
                        "ScopeName": "io.opentelemetry.contrib.clickhouse",
                        "ScopeVersion": "1.0.0",
                        "SpanAttributes": {"service.name":"v"},
                        "Duration": "0",
                        "StatusCode": "STATUS_CODE_UNSET",
                        "StatusMessage": "",
                        "Events.Timestamp": ["2023-05-15 08:37:07.987828000"],
                        "Events.Name": ["event1"],
                        "Events.Attributes": [{}],
                        "Links.TraceId": [""],
                        "Links.SpanId": [""],
                        "Links.TraceState": [""],
                        "Links.Attributes": [{"k":"v"}]
                },
                ...
        ]
}


ss := rs.ScopeSpans().AppendEmpty()
ss.Scope().SetName("io.opentelemetry.contrib.clickhouse")
ss.Scope().SetVersion("1.0.0")
ss.SetSchemaUrl("https://opentelemetry.io/schemas/1.7.0")
ss.Scope().SetDroppedAttributesCount(20)
ss.Scope().Attributes().PutStr("lib", "clickhouse")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we see assertions showing this data is indeed being ingested?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor Author

@Frapschen Frapschen May 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, are we need to add new columns for other fields, like InstrumentationScope.Attributes, InstrumentationScope.DroppedAttributesCount, etc? @atoulme @dmitryax

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, are we need to add new columns for other fields, like InstrumentationScope.Attributes, InstrumentationScope.DroppedAttributesCount, etc?

The scope attributes are not widely adopted in the OTel project, so they will likely be empty most of the time, but it may be reasonable to add them to avoid future breaking changes. Feel free to submit another PR

@github-actions
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@dmitryax dmitryax closed this Jun 21, 2023
@dmitryax dmitryax reopened this Jun 21, 2023
@dmitryax dmitryax merged commit eb6c42b into open-telemetry:main Jun 21, 2023
88 of 92 checks passed
@github-actions github-actions bot added this to the next release milestone Jun 21, 2023
@dmitryax
Copy link
Member

@Frapschen, we also need to do the same for logs now, right?

fchikwekwe pushed a commit to fchikwekwe/opentelemetry-collector-contrib that referenced this pull request Jun 23, 2023
@Frapschen Frapschen deleted the add_scope_to_span_table branch June 25, 2023 07:11
Caleb-Hurshman pushed a commit to observIQ/opentelemetry-collector-contrib that referenced this pull request Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[exporter/clickhouse] Add ScopeName ScopeVersion in span table
5 participants