-
Notifications
You must be signed in to change notification settings - Fork 487
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
Cleanup after the Otel upgrade #4359
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two suggestions.
For not syntax, we should migrate to the correct markdown as we come across them in the topics. It's fine to leave existing notes as-is for now.
> **NOTE**: `otelcol.exporter.jaeger` is a wrapper over the | ||
> [upstream](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/jaegerexporter) | ||
> OpenTelemetry Collector `jaeger` exporter. The upstream | ||
> exporter has been deprecated and will be removed from future versions of | ||
> both OpenTelemetry Collector and Grafana Agent because Jaeger supports OTLP directly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> **NOTE**: `otelcol.exporter.jaeger` is a wrapper over the | |
> [upstream](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/jaegerexporter) | |
> OpenTelemetry Collector `jaeger` exporter. The upstream | |
> exporter has been deprecated and will be removed from future versions of | |
> both OpenTelemetry Collector and Grafana Agent because Jaeger supports OTLP directly. | |
{{% admonition type="note" %}} | |
`otelcol.exporter.jaeger` is a wrapper over the [upstream](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/jaegerexporter) OpenTelemetry Collector `jaeger` exporter. | |
The upstream exporter has been deprecated and will be removed from future versions of both OpenTelemetry Collector and Grafana Agent because Jaeger supports OTLP directly. | |
{{% /admonition %}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use the > **NOTE**:
syntax in all the Flow Otel pages. I would be happy to change it, but it'd be best to do it for all pages at once so we are consistent. Would you like me to raise a separate issue for it? It would also be nice to know why the {{% admonition type="note" %}}
syntax is preferable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The > **NOTE**:
syntax formats the note as a blockquote. This works, but it relies on the blockquote formatting in the stylesheets staying constant and as expected.
The shortcode {{% admonition type="note" %}}
ensures that ALL notes are formatted the same regardless of where they are in the docs... same with warnings and cautions... and the stylesheet is easier to manage.
Refer also to https://grafana.com/docs/writers-toolkit/write/shortcodes/#admonition-shortcode for formatting of the admonition shortcode.
So yes, if it's in the template we should update it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we leave it as-is in this PR, that's fine. We should plan to update the template for future
docs/sources/flow/reference/components/otelcol.processor.batch.md
Outdated
Show resolved
Hide resolved
5b8b935
to
3b2ae1f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
func (a *Action) UnmarshalText(text []byte) error { | ||
str := Action(strings.ToLower(string(text))) | ||
switch str { | ||
case ActionInsert, ActionUpdate, ActionUpsert, ActionDelete: | ||
*a = str | ||
return nil | ||
default: | ||
return fmt.Errorf("unknown action %v", str) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to exist or is the Validate method enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UnmarshalText
needs to be implemented because otherwise River won't be able to unmarshal Action
. Since I already had to implement it, I thought I might as well verify if it's correct since it doesn't make sense to unmarshal to an incorrect value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UnmarshalText needs to be implemented because otherwise River won't be able to unmarshal Action.
Are you sure? Action is just a string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see, there's text transformation going on when unmarshaling to make it case insensitive. OK, that adds some validity to UnmarshalText but it's still not strictly necessary.
I'm ok with keeping it in both cases (including the tail sampling case being discussed below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The text transformation isn't the main reason. If I don't implement UnmarshalText
, I get this error:
panic: reflect.Set: value of type string is not assignable to type headers.Action [recovered]
panic: reflect.Set: value of type string is not assignable to type headers.Action
The text transformation was simply so that we match what the Collector does. TBH I'm not 100% sure if I like it or if we should just stick to some Agent convention, but I wasn't sure if we have a convention and thought this way it'll be easier to migrate Collector configs to the Agent.
func (e *ErrorMode) UnmarshalText(text []byte) error { | ||
str := ErrorMode(strings.ToLower(string(text))) | ||
switch str { | ||
case ErrorModeIgnore, ErrorModePropagate: | ||
*e = str | ||
return nil | ||
default: | ||
return fmt.Errorf("unknown error mode %v", str) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to exist or is the Validate method enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same as the Action
type in the other file in this PR.
UnmarshalText
needs to be implemented because otherwise River won't be able to unmarshal ErrorMode
. Since I already had to implement it, I thought I might as well verify if it's correct since it doesn't make sense to unmarshal to an incorrect value.
// OttlConditionCfg holds the configurable setting to create a OTTL condition filter | ||
// sampling policy evaluator. | ||
type OttlConditionCfg struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name here feels misaligned with our normal naming convention; this would usually be OTTLConditionConfig
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I changed the name of this type and all the other types in this file (they all used to end with Cfg
)
@@ -30,8 +29,7 @@ func init() { | |||
|
|||
// Arguments configures the otelcol.receiver.jaeger component. | |||
type Arguments struct { | |||
Protocols ProtocolsArguments `river:"protocols,block"` | |||
RemoteSampling *RemoteSamplingArguments `river:"remote_sampling,block,optional"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change, right? It should be documented as such in the changelog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, sure, since it's not documented I agree it's safe to remove without a breaking change notice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a discussion on this in the upstream PR, and I'm going to backtrack and just add an entry in the upgrade guide and in the changelog 😅
@@ -23,11 +23,36 @@ Main (unreleased) | |||
|
|||
- `otelcol.exporter.loki` now includes the instrumentation scope in its output. (@ptodev) | |||
|
|||
- `otelcol.extension.jaeger_remote_sampling` removes the `\` HTTP endpoint. The `/sampling` endpoint is still functional. | |||
- `otelcol.extension.jaeger_remote_sampling` removes the `/` HTTP endpoint. The `/sampling` endpoint is still functional. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that all breaking changes need to be documented with details and potential migration instructions in the upgrade guide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I forgot to update the guide in #3858. I added three entries to it now!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have much context, but it looks good to me from the outside 👍
46d1d2f
to
d4377d4
Compare
d67af11
to
d06c667
Compare
if e == nil || *e == "" { | ||
return ottl.ErrorMode("") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rfratto - after your review I had to fix a linter issue, and I added this clause. It feels dodgy because ottl.ErrorMode("")
is not a valid error mode, but I can't think of a better way to handle this. I'm just going to merge it as it is, I hope you don't mind.
* Cleanup after the Otel upgrade * Update docs/sources/flow/reference/components/otelcol.processor.batch.md Co-authored-by: Clayton Cornell <[email protected]> * PR review improvements * Update comment * Fix linter issue, document remote_sampling change --------- Co-authored-by: Clayton Cornell <[email protected]>
* Cleanup after the Otel upgrade * Update docs/sources/flow/reference/components/otelcol.processor.batch.md Co-authored-by: Clayton Cornell <[email protected]> * PR review improvements * Update comment * Fix linter issue, document remote_sampling change --------- Co-authored-by: Clayton Cornell <[email protected]>
PR Description
#3858 updated to version 0.80 of Otel Collector, but some work was still yet to be done. This PR completes the Otel upgrade by doing the following:
v1.0.0-rcv0013
of pdata and featuregate modules instead of the ones from the fork.This PR completes the upgrade to version 0.80 of the Collector. No more work is expected to be needed.
PR Checklist