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

feat: add server timing header injection #70

Merged
merged 9 commits into from
Apr 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

- Add injection of `Server-Timing` header.
([#70](https://github.com/signalfx/splunk-otel-js/pull/70))

## 0.6.0 (03-29-2021)

### Changed
Expand Down Expand Up @@ -57,4 +60,4 @@ in warnings for users on npm <7.
accept a processed `Options` instance and returns a `SpanProcessor`
instance or an array of `SpanProcessor` instances. It can be used to configure tracing
with custom Span Processor. If it returns multiple span processors, all of them will
be used.
be used.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ You can also instrument your app with code as described [here](#instrument-with-
| SPLUNK_SERVICE_NAME | serviceName | `unnamed-node-service` | The service name of this Node service. |
| SPLUNK_ACCESS_TOKEN | acceessToken | | | The optional organization access token for trace submission requests. |
| SPLUNK_MAX_ATTR_LENGTH | maxAttrLength | 1200 | Maximum length of string attribute value in characters. Longer values are truncated. |
| SPLUNK_CONTEXT_SERVER_TIMING_ENABLED | serverTimingEnabled | true | Enable injection of `Server-Timing` header to HTTP responses. |
| OTEL_RESOURCE_ATTRIBUTES | | unset | Comma-separated list of resource attributes added to every reported span. <details><summary>Example</summary>`key1=val1,key2=val2`</details>
| OTEL_TRACE_ENABLED | | `true` | Globally enables tracer creation and auto-instrumentation. |

Expand Down Expand Up @@ -155,6 +156,8 @@ startTracing({

- `maxAttrLength`: corresponds to the `SPLUNK_MAX_ATTR_LENGTH` environment variable. Defaults to `1200`. Configures the maximum length any span attribute value can have. Values longer than the specified length will be truncated.

- `serverTimingEnabled`: corresponds to the `SPLUNK_SERVER_TIMING_ENABLED` environment variable. Defaults to false. Enables injection of `Server-Timing` header to responses.

- `tracerConfig`: a JS object that is merged into the default tracer config replacing any existing keys and is passed on to the tracer provider during initialization. This can be used to customize the tracer provider or tracer. Must satisfy [`TracerConfig` interface](https://github.com/open-telemetry/opentelemetry-js/blob/71ba83a0dc51118e08e3148c788b81fe711003e7/packages/opentelemetry-tracing/src/types.ts#L26)

- `spanExporterFactory`: A function that accepts the options passed to startTracing function and returns a new instance of SpanExporter. When set, this function will be used to create a new exporter and the returned exporter will be used in the pipeline.
Expand Down
Loading