Tags: equinix-labs/otel-cli
Tags
fix exec span attrs (#316) (#318) During previous refactors of exec for other things, the span creation got moved to the top of the function, and then later code would manipulate config.Attributes, which no longer got picked up. Regression test added for #316. Since this functionality was broken for a bit, the attributes are being renamed along the way to match the OTel semantic specs. Detailed commitlog follows: * fix exec span attrs During previous refactors of exec for other things, the span creation got moved to the top of the function, and then later code would manipulate config.Attributes, which no longer got picked up. Regression test added for #316. Since this functionality was broken for a bit, the attributes are being renamed along the way to match the OTel semantic specs. Attributes are built up manually in protobuf structs because the helpers don't support array values. This could move to a helper later but seems fine as-is. * remove duplicate types * add regular expression capability for SpanData * test new attributes, fix bugs Adds a new RE test for generated attributes. Refactors exec.go to fix some bugs discovered and add more attributes. Since the protobuf expression of attributes is so verbose, it's now in its own funcs at the bottom to keep the doExec() function readable. * remove extra linefeed * add CHANGELOG notes for bugfix
#81 template traceparent into exec command args (#308) Modifies the default behavior of `otel-cli exec` so that command-line arguments to the child process are modified to inject the traceparent anywhere `{{traceparent}}` appears in them. This makes patterns like this work: ```shell export TRACEPARENT=00-5b28ee2bf1f1796cca65bef26fb90c35-9d699b596c3dced3-01 ./otel-cli exec --endpoint localhost:4317 -- curl --verbose -H 'traceparent: {{traceparent}}' https://github.com ``` This can be disabled with a new extra argument: `otel-cli exec --tp-disable-inject`. ## Squashed Commits * add support to template traceparent into exec command args ``` $ go build && TRACEPARENT=00-5b28ee2bf1f1796cca65bef26fb90c35-9d699b596c3dced3-01 ./otel-cli exec --endpoint localhost:4317 -- curl --verbose -H 'traceparent: {{tr aceparent}}' http://tobert.org * Trying 45.33.3.11:80... * Connected to tobert.org (45.33.3.11) port 80 (#0) > GET / HTTP/1.1 > Host: tobert.org > User-Agent: curl/7.81.0 > Accept: */* > traceparent: 00-5b28ee2bf1f1796cca65bef26fb90c35-433d7e8620e9ccea-01 ``` * update CHANGELOG.md * add an example of injecting traceparent into exec args * add a test for exec tp injection * remove unneeded regular expression on cmd output * add --tp-disable-inject to otel-cli exec along with tests * group injection tests in a suite Not a big deal, but makes a touch more sense.
#81 template traceparent into exec command args (#308) Modifies the default behavior of `otel-cli exec` so that command-line arguments to the child process are modified to inject the traceparent anywhere `{{traceparent}}` appears in them. This makes patterns like this work: ```shell export TRACEPARENT=00-5b28ee2bf1f1796cca65bef26fb90c35-9d699b596c3dced3-01 ./otel-cli exec --endpoint localhost:4317 -- curl --verbose -H 'traceparent: {{traceparent}}' https://github.com ``` This can be disabled with a new extra argument: `otel-cli exec --tp-disable-inject`. ## Squashed Commits * add support to template traceparent into exec command args ``` $ go build && TRACEPARENT=00-5b28ee2bf1f1796cca65bef26fb90c35-9d699b596c3dced3-01 ./otel-cli exec --endpoint localhost:4317 -- curl --verbose -H 'traceparent: {{tr aceparent}}' http://tobert.org * Trying 45.33.3.11:80... * Connected to tobert.org (45.33.3.11) port 80 (#0) > GET / HTTP/1.1 > Host: tobert.org > User-Agent: curl/7.81.0 > Accept: */* > traceparent: 00-5b28ee2bf1f1796cca65bef26fb90c35-433d7e8620e9ccea-01 ``` * update CHANGELOG.md * add an example of injecting traceparent into exec args * add a test for exec tp injection * remove unneeded regular expression on cmd output * add --tp-disable-inject to otel-cli exec along with tests * group injection tests in a suite Not a big deal, but makes a touch more sense.
documentation updates (#215) * add new flags to the config table * remove note about envvars since that's fixed now * add traces_endpoint to the example config * add CHANGELOG.md Backfilled old releases with info from the GH releases and vague recollections.
TLS naming cleanup (#166) Make all TLS settings use the same words & order. Over the course of developing the functionality I created a few variations. There's little functional change in this PR, mostly making the code easier to follow. * rename some TLS keys and variables to be consistent Renames NoTlsVerify to TlsNoVerify, adds Tls prefix to client cert vars & config keys. Adds missing config methods. Update tests to match new keys & methods. Fills in some gaps from first adding the TLS support. Adds comments indicating --no-tls-verify and its related envvar are deprecated. * rename test template variables to match config keys & flags * add TLS settings to README.md
#142 follow spec for OTLP protocol (#148) Per #142, recent PRs had otel-cli deviate from the OTel standards for selecting OTLP exporter protocol. This PR revises the protocol handling for `--endpoint` and adds `--protocol` to more closely or exactly follow the spec. Matching envvars `OTEL_EXPORTER_OTLP_PROTOCOL` and `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL` have been added as well. From the README.md: otel-cli deviates from the OTel specification for endpoint URIs. Mainly, otel-cli supports bare host:port for grpc endpoints and continues to default to gRPC. The optional http/json is not supported by opentelemetry-go so otel-cli does not support it. To use gRPC with an http endpoint, set the protocol with --protocol or the envvar. * bare host:port endpoints are assumed to be gRPC and are not supported for HTTP * http:// and https:// are assumed to be HTTP unless --protocol is set to grpc. * loopback addresses without an https:// prefix are assumed to be unencrypted * go mod tidy seems to be cruft leftover from the renovate bot merge * add --protocol flag & envvar + failing tests Adds the flag & envvars along with a bunch of tests that mostly fail at this point. Once these all pass it should be good to ship. * set correct test server protocol on new tests * minor improvements to failure testing Don't try to parse JSON output when command is expected to fail. Initialize empty maps in results so they don't come back as nil in failure tests. * tune up tests, get them to pass Lots of little adjustments all over. gRPC with http endpoints now works when protocol is grpc. Protocol flag & envvars seem to be fully implemented. Removed mentions of http/json since opentelemetry-go doesn't support it. Updated README to reflect new functionality. * fix up README text * remove OtelError from tests It doesn't work anyways, will revisit when/if it's needed.
Upgrade jaeger and otel collector images: (#104) Lots of updates to otel collect. For my testing most notably the status codes in jaeger were not being parsed correctly. This resolves this. Signed-off-by: Jacob Weinstock <jakobweinstock@gmail.com>
PreviousNext