-
Notifications
You must be signed in to change notification settings - Fork 12
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
Document actor paths configuration #635
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
sidebar_position: 3 | ||
--- | ||
|
||
# Configuration | ||
|
||
There are multiple ways to configure the Agent, including system properties, environment variables, and providing the configuration file. | ||
|
||
To provide the configuration file to the agent you can either `-Dotel.javaagent.configuration-file=<path-to-file>` or `OTEL_JAVAAGENT_CONFIGURATION_FILE` environment varaible. | ||
|
||
## OTEL namespace options | ||
|
||
You can find the full list of available configuration options [here](https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md) | ||
|
||
## Mesmer options | ||
|
||
### Akka actors grouping | ||
|
||
When the actors' hierarchy grows or there are short-living actors referenced by a unique path name, it can be impractical to give each metric a unique set of attributes. This amplifies the amount of data exported and can affect collector performance. To solve this, Mesmer allows the definition of fine-grained rules on how metrics associated with different actors can be grouped together. | ||
|
||
There are three actor attributes grouping options: | ||
- **group** - the metrics, collected for all the actors matching the given path, share the `actor_path` attribute. | ||
- **instance** - the metrics, collected for actors matching this path, have a unique `actor_path` attribute. | ||
- **disabled** - the metrics, collected for all the actors matching the given path, do not get `actor_path` attribute. | ||
|
||
By default the path grouping is disabled. You can change this by launching the Mesmer extension with `-Dio.scalac.mesmer.actor.reporting-default=group` configuration option. This will give all the actors' metrics the attribute `actor_path="/"`. | ||
|
||
Alternatively, it is possible to override a single path grouping strategy as following | ||
``` | ||
java -javaagent:path/to/opentelemetry-javaagent.jar \ | ||
-Dotel.javaagent.extensions=path/to/mesmer-otel-extension.jar \ | ||
-Dio.scalac.mesmer.actor.reporting-default=ignore \ | ||
-Dio.scalac.mesmer.actor.rules."/user/**"=group \ | ||
-Dio.scalac.mesmer.actor.rules."/system/**"=group \ | ||
-jar your-app.jar | ||
``` | ||
This configuration will aggregate metrics for system and user hierarchies separately, grouping them by `actor_path="/system"` and `actor_path="/user"` attributes correspondingly. | ||
|
||
The individual rule syntax is `io.scalac.mesmer.actor.rules."<MATCHING_PATH>"=<GROUPING_OPTION>`. The matching path supports limited set of wildcards, aiding to group metrics for variable path segments. | ||
|
||
- **/** - matches exactly one actor and therefore can be used only with the `instance` grouping option. | ||
For a topology of */user/my-actor* and */user/my-actor/1* and the rules | ||
``` | ||
io.scalac.mesmer.actor.reporting-default=group | ||
io.scalac.mesmer.actor.rules."/user/my-actor"=instance | ||
``` | ||
the metrics from */user/my-actor* will get the attribute `actor_path="/user/my-actor"` while the metrics from */user/my-actor/1* will get the attribute `actor_path="/"` and likely will be grouped with metrics from other actors. | ||
|
||
- **/\*** - matches a single variable tailing segment. | ||
For a topology of */user/my-actor*, */user/my-actor/1*, */user/my-other-actor* and the rules | ||
``` | ||
io.scalac.mesmer.actor.reporting-default=ignore | ||
io.scalac.mesmer.actor.rules."/user/*"=instance | ||
``` | ||
the metrics from */user/my-actor* and */user/my-other-actor* will get same values for `actor_path` attribute, while */user/my-actor/1* will be ignored. | ||
|
||
- **/\*\*** - matches all tailing segments. | ||
For a topology of */user/my-actor*, */user/my-actor/1*, */user/my-other-actor* and the rules | ||
``` | ||
io.scalac.mesmer.actor.reporting-default=ignore | ||
io.scalac.mesmer.actor.rules."/user/**"=instance | ||
``` | ||
this will produce a unique metric for each actor with root at */user*. This wildcard also can be applied using with grouping, | ||
|
||
``` | ||
io.scalac.mesmer.actor.reporting-default=ignore | ||
io.scalac.mesmer.actor.rules."/user/**"=group | ||
``` | ||
|
||
Resulting in all metrics from actors with root at */user* to be aggregated using common attribute `actor_path="/user"` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 3 | ||
sidebar_position: 4 | ||
--- | ||
|
||
# Supported metrics | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lgajowy I described the actual behaviour of the current implementation as is, but the implementation it's what bothers me. For most paths definitions there is no distinction between
instance
andgroup
option behaviour. Similarly different rules can lead to the same results and it's quite confusing which definition is preferred.I believed the current implementation is the result of incremental evolution of the requirements. I suggest, for some future version of Mesmer, to define and document the exact specification on path matching first and then rewrite the entire matching logic from scratch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yeah. Couldn't frame that better. Thanks for that input!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#636
I created an issue for fixing that