Caution
The SignalFx Instrumentation for .NET is deprecated as of February 21, 2024 and will reach End of Support on February 21 2025. Until then, only critical security fixes and bug fixes will be provided. After the date, the library will be archived and no longer maintained.
New customers instrumenting the .NET ecosystem should use the Splunk Distribution of OpenTelemetry .NET. Existing customers should consider migrating to Splunk Distribution of OpenTelemetry .NET which offers similar capabilities. To learn how to migrate, see Migrate from the SignalFx .NET Instrumentation.
Configure the SignalFx Instrumentation for .NET π
You can configure the SignalFx Instrumentation for .NET to suit your instrumentation needs. In most cases, modifying the basic configuration is enough to get started. More advanced settings are also available.
Configuration methods π
You can change the settings of the SignalFx Instrumentation for .NET in the following ways:
Set environment variables. On Windows, set them in the process scope unless you want to activate autoinstrumentation globally for all .NET applications.
Edit the web.config or app.config file. For example:
<configuration> <appSettings> <add key="SIGNALFX_SERVICE_NAME" value="my-service-name" /> </appSettings> </configuration>
Generate a JSON configuration file and set the
SIGNALFX_TRACE_CONFIG_FILE
environment variable to the path of the file. You can define settings as key-value pairs:{ "SIGNALFX_SERVICE_NAME": "my-service-name" }
Note
Settings defined using environment variables override settings in XML and JSON configuration files.
General settings π
The following settings are common to most instrumentation scenarios:
Setting |
Description |
---|---|
|
The value for the |
|
The name of the application or service. If not set, the instrumentation looks for a suitable default name. See Changing the default service name. |
|
The version of the application. When set, it adds the |
|
Names of the executable files that the profiler can instrument. Supports multiple semicolon-separated values, for example: |
|
Names of the executable files that the profiler cannot instrument. Supports multiple semicolon-separated values, for example: |
|
Path of the JSON configuration file. Set this environment variable if youβre configuring the instrumentation using a JSON file. See Configuration methods for more information. |
|
Set to |
|
Set to |
|
Location of the installed instrumentation. Must be set manually to |
Exporter settings π
The following settings control trace exporters and their endpoints:
Setting |
Description |
---|---|
|
Splunk Observability Cloud access token for your organization. The token activates sending traces directly to the Splunk Observability Cloud ingest endpoint. To obtain an access token, see Retrieve and manage user API access tokens using Splunk Observability Cloud. |
|
The name of your organizationβs realm, for example, |
|
The URL to where the trace exporter sends traces. The default value is |
|
The URL to where the metrics exporter sends metrics. The default value is |
|
Activate to export traces that contain a minimum number of closed spans, as defined by |
|
Minimum number of closed spans in a trace before itβs exported. The default value is |
Trace propagation settings π
The following settings control trace propagation:
Setting |
Description |
---|---|
|
Comma-separated list of propagators for the tracer. The available propagators are |
.NET settings for AlwaysOn Profiling π
The following settings control the AlwaysOn Profiling feature for the .NET instrumentation:
Environment variable |
Description |
---|---|
|
Activates AlwaysOn Profiling. The default value is |
|
Activates memory profiling. The default value is |
|
The collector endpoint for profiler logs. The default value is |
|
Frequency with which call stacks are sampled, in milliseconds. The default value is |
Note
For more information on AlwaysOn Profiling, see Introduction to AlwaysOn Profiling for Splunk APM.
Metrics settings π
The following settings control metric collection:
Setting |
Description |
---|---|
|
Configuration pattern for activating or deactivating a specific metrics group. For example, to activate |
Note
NetRuntime metrics are always collected if memory profiling is activated.
Instrumentation settings π
The following settings control instrumentations and tracing behavior:
Setting |
Description |
---|---|
|
Comma-separated list of key-value pairs that specify global span tags. For example: |
|
Maximum length of the value of an attribute. Values longer than this value are truncated. Values are discarded entirely when set to |
|
Comma-separated list of library instrumentations you want to deactivate. Each value must match an internal instrumentation ID. See Supported libraries for a list of integration identifiers. |
|
Activates or deactivates a specific instrumentation library. For example, to deactivate the Kafka instrumentation, set |
Library-specific instrumentation settings π
The following settings control the behavior of specific instrumentations:
Setting |
Description |
---|---|
|
Comma-separated list of HTTP client response statuses or ranges for which the spans are set as errors, for example: |
|
Comma-separated list of HTTP server response statuses or ranges for which the spans are set as errors, for example: |
|
Activates the tagging of a |
|
Activates the tagging of a |
|
Activates the tagging of Redis commands as |
|
Activates the updated WCF instrumentation, which delays execution until later in the WCF pipeline when the WCF server exception handling is established. The default value is |
|
Comma-separated map of HTTP header keys to tag names, automatically applied as tags on traces. For example: |
|
Comma-separated list of URL substrings. Matching URLs are ignored by the tracer. For example, |
|
Activate to close consumer scope upon entering a method and starting a new one on method exit. The default value is |
|
Activate to base ASP.NET span and resource names on routing configuration, if applicable. The default value is |
Server trace information π
To connect Real User Monitoring (RUM) requests from mobile and web applications with server trace data, trace response headers are activated by default. The instrumentation adds the following response headers to HTTP responses:
Access-Control-Expose-Headers: Server-Timing
Server-Timing: traceparent;desc="00-<serverTraceId>-<serverSpanId>-01"
The Server-Timing
header contains the traceId
and spanId
parameters in traceparent
format. W3C tracecontext and W3C baggage context propagation is activated by default. For more information, see the Server-Timing and traceparent documentation on the W3C website.
Note
If you need to deactivate trace response headers, set SIGNALFX_TRACE_RESPONSE_HEADER_ENABLED
to false
.
Query string settings π
Note
This feature is only available when instrumenting ASP.NET Core applications.
The following settings control the inclusion of query strings in the http.url
tag for ASP.NET Core instrumented applications.
Setting |
Description |
---|---|
|
Activates or deactivates query string inclusion in the |
|
Custom regular expression to obfuscate query strings. The default value is shown in the example. |
|
Timeout to the execution of the query string obfuscation pattern defined in |
Obfuscating query string prevents your applications from sending sensitive data to Splunk.
The default regular expression for query obfuscation is the following:
((?i)(?:p(?:ass)?w(?:or)?d|pass(?:_?phrase)?|secret|(?:api_?|private_?|public_?|access_?|secret_?)key(?:_?id)?|token|consumer_?(?:id|key|secret)|sign(?:ed|ature)?|auth(?:entication|orization)?)(?:(?:\s|%20)*(?:=|%3D)[^&]+|(?:""|%22)(?:\s|%20)*(?::|%3A)(?:\s|%20)*(?:""|%22)(?:%2[^2]|%[^2]|[^""%])+(?:""|%22))|bearer(?:\s|%20)+[a-z0-9\._\-]|token(?::|%3A)[a-z0-9]{13}|gh[opsu]_[0-9a-zA-Z]{36}|ey[I-L](?:[\w=-]|%3D)+\.ey[I-L](?:[\w=-]|%3D)+(?:\.(?:[\w.+\/=-]|%3D|%2F|%2B)+)?|[\-]{5}BEGIN(?:[a-z\s]|%20)+PRIVATE(?:\s|%20)KEY[\-]{5}[^\-]+[\-]{5}END(?:[a-z\s]|%20)+PRIVATE(?:\s|%20)KEY|ssh-rsa(?:\s|%20)*(?:[a-z0-9\/\.+]|%2F|%5C|%2B){100,})`
Diagnostic logging settings π
The following settings control the internal logging of the SignalFx Instrumentation for .NET:
Setting |
Description |
---|---|
|
Activate to generate troubleshooting logs using the |
|
Activates file logging. The default value is |
|
The maximum size for tracer log files, in bytes. The default value is |
|
Activates |
|
Configures the |
|
Activate to activate debugging mode for the tracer. The default value is |
|
Directory of the .NET tracer logs. Overrides the value in |
|
The number of seconds between identical log messages for tracer log files. Setting this environment variable to |
|
Activate to activate diagnostic logs at startup. The default value is |
Changing the default service name π
By default, the SignalFx Instrumentation for .NET retrieves the service name by trying the following steps until it succeeds:
For the SignalFx .NET Tracing Azure Site Extension, the default service name is the site name as defined by the
WEBSITE_SITE_NAME
environment variable.For ASP.NET applications, the default service name is
SiteName[/VirtualPath]
.For other applications, the default service name is the name of the entry assembly. For example, the name of your .NET project file.
If the entry assembly is not available, the instrumentation tries to use the current process name. The process name can be
dotnet
if launched directly using an assembly. For example,dotnet InstrumentedApp.dll
.
If all the steps fail, the service name defaults to UnknownService
.
To override the default service name, set the SIGNALFX_SERVICE_NAME
environment variable.