agardnerIT / tracepusher

Generate and push OpenTelemetry Trace data to an OTEL collector in JSON format
Apache License 2.0
53 stars 11 forks source link

Enhancement: Add ability to set span type #53

Closed agardnerIT closed 1 year ago

agardnerIT commented 1 year ago

Related to #51: Add the ability to set the span type.

Currently, tracepusher is hardcoded to have a span type of SPAN_KIND_INTERNAL

https://github.com/agardnerIT/tracepusher/blob/cfec80193bd0d4a2770989a32f941c53670af406/tracepusher.py#L271

This enhancement will:

Expected valid values for this new flag will be:

These values can be provided by the end-user in any cApITalisatION form. The code should uppercase the input then append to SPAN_KIND so an input of CLiENT would become SPAN_KIND_CLIENT.

If anything other than the values above are provided, an error is to be thrown and the trace will not be sent.

See these for more info on the spec:

agardnerIT commented 1 year ago

Resolved with: https://github.com/agardnerIT/tracepusher/commit/fd6bf1e7851b50530ef03669c802b5af178cb3eb