DD_SERVICE; DD_ENV; DD_VERSION env vars support
* Config.valueOf("", null, "") with throw NPE
* mark unused public fields @Deprecated in Config.java
* keep unused public fields untouched
* retrun 2arg Config ctor
To stream line configuration in the future intropduce
`DD_API_KEY`/`DD_API_KEY_FILE` to provide agent with API
key. Currently this is only used for profiling but later may be used
for other parts of the agent too.
Config.toString() method is dumped when logging in debug the conf.
It includes in some case the profile api key when used with env vars.
Also proxy password is also dumped.
toString method generated by Lombok now excludes both fields
* add ..."metrics":{"_dd.measured":1}... to every span
* update tests to always have "metrics":{"_dd.measured":1} in every span
Authored-by: Lev Priima <lev.priima@data.dog>
This should help avoid too frequent of stacktraces when the configured threshold is a normal duration.
Alternatively, we could make it a percentage above the average.
(But only when span is not errored or finished on a different thread.)
Use the following config:
```
-Ddd.trace.span.duration.stacktrace.millis=1000
```
(One second is the default, 0 disables.)
When limit is exceeded, a NoopScope is returned.
Allow custom ScopeManager to be provided, with the plan to remove `ScopeContext` customization in the future.
This is a more generic form of the previous `split-by-domain` and `split-by-instance`.
(Note: evaluation is done when a tag is set, so If multiple tags are configured, the last tag set will take precidence.)
For example, this setting can be used to rename `aws-sdk` spans to be identified with the corresponding `aws.service` tag:
```
-Ddd.trace.split-by-tags=aws.service
```
There are some slight differences with this setting compared with`dd.trace.http.client.split-by-domain` and `dd.trace.db.client.split-by-instance`. `split-by-tags` applies to every span, where `split-by-domain` and `split-by-instance` only apply to http and db client spans respectively.
The core changes are in Config and ServerDecorator.
Moved default tagging from Config::getRuntimeTags to Config::getLocalRootSpanTags. This changes the result of Config::getMergedJmxTags as well.
To preserve language for servers changed ServerDecorator::afterStart.
Other changes are in tests - the most complicated part is in TagsAssert::defaultTags. This now contains a bit too much conditional logic for my liking.