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

Bump otel dependencies to v0.115.0/v1.21.0 #1485

Open
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

dricross
Copy link
Contributor

@dricross dricross commented Jan 6, 2025

Description of the issue

We need to track and pull in changes from upstream periodically.

Major changes to lookout for:

Description of changes

Merge OTel contrib v0.115.0/v1.21.0. Previous version was v0.103.0

License

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Tests

Requirements

Before commit the code, please do the following steps.

  1. Run make fmt and make fmt-sh
  2. Run make lint

@dricross dricross requested a review from a team as a code owner January 6, 2025 15:13
@dricross dricross force-pushed the dricross/otel-bump-v0.115.0 branch from 73b1131 to d61236c Compare January 9, 2025 15:56
@dricross dricross force-pushed the dricross/otel-bump-v0.115.0 branch from d61236c to f2ac15b Compare January 9, 2025 16:06
Copy link
Contributor

This PR was marked stale due to lack of activity.

@github-actions github-actions bot added the Stale label Jan 17, 2025
@github-actions github-actions bot removed the Stale label Jan 28, 2025
@dricross dricross changed the title Dricross/otel bump v0.115.0 Bump otel dependencies to v0.115.0/v1.22.0 Feb 2, 2025
@dricross dricross changed the title Bump otel dependencies to v0.115.0/v1.22.0 Bump otel dependencies to v0.115.0/v1.21.0 Feb 2, 2025
@@ -135,7 +134,6 @@ func Factories() (otelcol.Factories, error) {
awsproxy.NewFactory(),
entitystore.NewFactory(),
server.NewFactory(),
ballastextension.NewFactory(),
Copy link
Contributor

Choose a reason for hiding this comment

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

does this no longer exist anymore with the upgrade? Seems odd -- I assume customers could be using this as part of their adot config?

Copy link
Contributor Author

@dricross dricross Feb 11, 2025

Choose a reason for hiding this comment

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

yeah it was deprecated in v0.92.0 of open-telemetry-collector-contrib and then completely removed in v0.108.0. It was added for adot parity. confirmed with @jefchien we should be able to remove it

@@ -22,7 +22,11 @@ exporters:
enabled: false
http2_ping_timeout: 0s
http2_read_idle_timeout: 0s
idle_conn_timeout: 1m30s
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe the values come from http.DefaultTransport which is 90s: https://github.com/golang/go/blob/master/src/net/http/transport.go#L53. Here's the commit where this was changed: open-telemetry/opentelemetry-collector@4d0b088

@@ -28,7 +28,11 @@ exporters:
enabled: false
http2_ping_timeout: 0s
http2_read_idle_timeout: 0s
idle_conn_timeout: 1m30s
Copy link
Contributor

Choose a reason for hiding this comment

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

is this the default? I presume this shouldn't break anything

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is the default, yeah. Upstream is being more explicit about setting the clientConfig default values to http.DefaultTransport which shows up in our config files. See open-telemetry/opentelemetry-collector@4d0b088

@lisguo
Copy link
Contributor

lisguo commented Feb 11, 2025

pr build is failing

@@ -134,6 +134,7 @@ jobs:
- uses: actions/checkout@v3
with:
repository: ${{env.CWA_GITHUB_TEST_REPO_NAME}}
ref: ab30cf84d0254506c92502ce185d25dd72701c81
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IIRC correctly, there was a problem with the main branch of the test repo and I needed to pull a specific commit to get the tests to run. I can undo this

extension/entitystore/extension_test.go Show resolved Hide resolved
)

replace github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware => github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware v0.0.0-20250207173954-4e1c56b92f1e
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: This can just be in the dependency block. There's nothing to replace since v0.115.0 of the middleware extension doesn't exist.

github.com/gin-gonic/gin v1.10.0
github.com/go-kit/log v0.2.1
github.com/go-playground/validator/v10 v10.20.0
github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31
github.com/gobwas/glob v0.2.3
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.6.0
github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd // indirect
github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc // indirect
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Move to indirect block.

@@ -62,11 +63,10 @@ func (a Adapter) createMetricsReceiver(ctx context.Context, settings receiver.Cr

rcvr := newAdaptedReceiver(input, ctx, consumer, settings.Logger)

scraper, err := scraperhelper.NewScraper(
settings.ID.Type().String(),
scraper, err := scraper.NewMetrics(
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: scraper variable shadows scraper package.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch

@@ -47,7 +47,7 @@ func TestComponents(t *testing.T) {
"cumulativetodelta",
"deltatorate",
"ec2tagger",
"experimental_metricsgeneration",
"metricsgeneration",
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice that it's no longer experimental

Comment on lines +124 to +125
traces:
level: Basic
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 change the translator so this is None?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I'll take a look at that

@@ -294,7 +294,7 @@ extensions:
certificate_file_path: ""
dialer:
timeout: 0s
endpoint: 0.0.0.0:2000
endpoint: localhost:2000
Copy link
Contributor

Choose a reason for hiding this comment

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

This should not have changed. We'll need to set a default in the configuration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok

Comment on lines +251 to +254
Receivers TranslatorMap[component.Config, component.ID]
Processors TranslatorMap[component.Config, component.ID]
Exporters TranslatorMap[component.Config, component.ID]
Extensions TranslatorMap[component.Config, component.ID]
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Could all be ComponentTranslatorMaps.

Comment on lines +233 to +235
type ID interface {
String() string
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: This is the exact same interface as fmt.Stringer. Just use that instead.

return t.list.Len()
}

// NewTranslatorMap creates a TranslatorMap from the translators.
func NewTranslatorMap[C any](translators ...Translator[C]) TranslatorMap[C] {
t := translatorMap[C]{
func NewTranslatorMap[C any, ID TranslatorID](translators ...Translator[C, ID]) translatorMap[C, ID] {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
func NewTranslatorMap[C any, ID TranslatorID](translators ...Translator[C, ID]) translatorMap[C, ID] {
func NewTranslatorMap[C any, ID TranslatorID](translators ...Translator[C, ID]) TranslatorMap[C, ID] {


func NewTranslatorWithStatusCode(name component.DataType, operations []string, isStatusCodeEnabled bool) common.Translator[component.Config] {
func NewTranslatorWithStatusCode(name Name, operations []string, isStatusCodeEnabled bool) common.ComponentTranslator {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why can't we just pass in the equivalent of the component.DataType, which in this case would be pipeline.Signal?

MetricsName = Name(pipeline.SignalMetrics.String())
LogsName = Name(pipeline.SignalLogs.String())
TracesName = Name(pipeline.SignalTraces.String())
StatusCodeName = Name("statuscode")
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this for?

}

// ComponentTranslator is a translator that
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Incomplete comment

Comment on lines +258 to +261
type ComponentTranslator = Translator[component.Config, component.ID]
type ComponentTranslatorMap = TranslatorMap[component.Config, component.ID]
type PipelineTranslator = Translator[*ComponentTranslators, pipeline.ID]
type PipelineTranslatorMap = TranslatorMap[*ComponentTranslators, pipeline.ID]
Copy link
Contributor

Choose a reason for hiding this comment

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

Could likely add convenience functions for NewTranslatorMap as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants