-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
🚶➡️ [DNM] feat: new controller_build_info metric #13269
base: opentelemetry-configuration
Are you sure you want to change the base?
Conversation
0ed5767
to
f4a1b61
Compare
e467bdd
to
fbe886c
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.
Docs and naming comments
@@ -201,6 +201,21 @@ Metrics for the [Four Golden Signals](https://sre.google/sre-book/monitoring-dis | |||
Some metric attributes may have high cardinality and are marked with ⚠️ to warn you. You may need to disable this metric or disable the attribute. | |||
<!-- titles should be the exact metric name for deep-linking, alphabetical ordered --> | |||
<!-- titles are without argo_workflows prefix --> | |||
#### `controller_build_info` |
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.
#### `controller_build_info` | |
#### `build_info` |
isn't "controller" redundant here?
we should have more server metrics as well, but they're emitted separately by separate containers, so I would think we wouldn't need to distinguish
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.
also wonder if build_metadata
might be more explicit
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.
Or just version
to match argo version
#### `controller_build_info` | |
#### `version` |
version_metadata
would work too
@@ -201,6 +201,21 @@ Metrics for the [Four Golden Signals](https://sre.google/sre-book/monitoring-dis | |||
Some metric attributes may have high cardinality and are marked with ⚠️ to warn you. You may need to disable this metric or disable the attribute. | |||
<!-- titles should be the exact metric name for deep-linking, alphabetical ordered --> | |||
<!-- titles are without argo_workflows prefix --> | |||
#### `controller_build_info` | |||
|
|||
The build information for this workflow controller |
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 build information for this workflow controller | |
Build metadata for this Controller. |
simplify
|
||
| attribute | explanation | | ||
|-------------|------------------------------------------------------------------------| | ||
| `version` | The version of argo-workflows | |
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.
| `version` | The version of argo-workflows | | |
| `version` | The version of Argo | |
It's referred to as "Argo" in nearly all docs (similar to #13077 (comment))
| attribute | explanation | | ||
|-------------|------------------------------------------------------------------------| | ||
| `version` | The version of argo-workflows | | ||
| `platform` | Platform this is running on, as go describes it e.g. `linux/amd64` | |
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.
| `platform` | Platform this is running on, as go describes it e.g. `linux/amd64` | | |
| `platform` | The [Go platform](https://go.dev/doc/install/source#environment) compiled for. Example: `linux/amd64` | |
- link to the docs for
GOOS
+GOARCH
, otherwise this feels quite unclear. I'm tempted to further explain that as a combination of "OS and architecture".- it's also what it's compiled for, not necessarily what it's running on
- I could not find a better official link for this either 😕
- avoid Latin phrases, per k8s style guide
|-------------|------------------------------------------------------------------------| | ||
| `version` | The version of argo-workflows | | ||
| `platform` | Platform this is running on, as go describes it e.g. `linux/amd64` | | ||
| `gover` | Version of go that built this workflow controller | |
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.
| `gover` | Version of go that built this workflow controller | | |
| `goversion` | Version of Go used | |
- why not use the full "version"? I read "gover" as "gopher" initially (which ironically works)
- simplify
- half of the metrics don't say "this workflow controller" and half do. be consistent
- it's redundant, so we can just be consistent in removing it
- half of the metrics don't say "this workflow controller" and half do. be consistent
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.
also isn't the convention to use underscores? or is it different for attribute names vs metric names?
| `gover` | Version of go that built this workflow controller | | |
| `go_version` | Version of Go used | |
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.
Underscores are explicitly mentioned as word delimiters for attribute names in the convention docs: https://opentelemetry.io/docs/specs/semconv/general/attribute-naming/
So the second suggestion should be used.
It would also be be consistent with argo version
which prints GoVersion
| `commit` | The full git SHA1 of the code that built this workflow controller | | ||
| `treestate` | Whether the git tree was `dirty` or `clean` when this was built | | ||
| `tag` | The tag on the git commit or `untagged` if it was not tagged | |
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.
| `commit` | The full git SHA1 of the code that built this workflow controller | | |
| `treestate` | Whether the git tree was `dirty` or `clean` when this was built | | |
| `tag` | The tag on the git commit or `untagged` if it was not tagged | | |
| `git_commit` | The full Git SHA1 commit | | |
| `git_tree_state` | Whether the Git tree was `dirty` or `clean` when built | | |
| `git_tag` | The Git tag or `untagged` if it was not tagged | |
- match
argo version
and split words with underscores per OTel convention - simplify
- "Git" as proper noun
const nameBuildInfo = `controller_build_info` | ||
err := m.createInstrument(int64Counter, | ||
nameBuildInfo, | ||
"Build Information for the Argo Workflows Controller", |
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.
"Build Information for the Argo Workflows Controller", | |
"Build metadata for this Controller", |
same as above
labelBuildGoVer string = `goversion` | ||
labelBuildDate string = `build` | ||
labelBuildCompiler string = `compiler` | ||
labelBuildGitCommit string = `commit` | ||
labelBuildGitTreeState string = `treestate` | ||
labelBuildGitTag string = `tag` |
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.
labelBuildGoVer string = `goversion` | |
labelBuildDate string = `build` | |
labelBuildCompiler string = `compiler` | |
labelBuildGitCommit string = `commit` | |
labelBuildGitTreeState string = `treestate` | |
labelBuildGitTag string = `tag` | |
labelBuildGoVersion string = `go_version` | |
labelBuildDate string = `build_date` | |
labelBuildCompiler string = `compiler` | |
labelBuildGitCommit string = `git_commit` | |
labelBuildGitTreeState string = `git_tree_state` | |
labelBuildGitTag string = `git_tag` |
same as above for docs, matching argo version
and splitting words with underscores per OTel convention
|
||
version := argo.GetVersion() | ||
m.addInt(ctx, nameBuildInfo, 1, instAttribs{ | ||
{name: labelBuildVersion, value: version.Version}, |
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.
is there any way to add descriptions to attributes in OTel?
|
||
func TestBuildInfo(t *testing.T) { | ||
_, te, err := CreateDefaultTestMetrics() | ||
if assert.NoError(t, err) { |
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.
could invert the conditional here as well
f4a1b61
to
3030d84
Compare
fbe886c
to
9d4b210
Compare
3030d84
to
aab55e2
Compare
9d4b210
to
e42b80d
Compare
aab55e2
to
4c454e5
Compare
One of the metrics #12589. Add new, static metric which contains labels from the product version fields. This is common good practice, and puts the information about which version of a controller was running that a given point in time. This can be useful when diagnosing issues that occurred, and also shows the progress of a version rollout when that happens. Note to reviewers: this is part of a stack of reviews for metrics changes. Please don't merge until the rest of the stack is also ready. Signed-off-by: Alan Clucas <alan@clucas.org>
e42b80d
to
b9c6b77
Compare
One of the new metrics of #12589.
Add new, static metric which contains labels from the product version fields.
This is common good practice, and puts the information about which version of a controller was running that a given point in time.
This can be useful when diagnosing issues that occurred, and also shows the progress of a version rollout when that happens.
Note to reviewers: this is part of a stack of reviews for metrics changes. Please don't merge until the rest of the stack is also ready.
Signed-off-by: Alan Clucas alan@clucas.org