Note: Team accounts are only available to paid customers with an annual agreement.
Scalyr Agent v2.1.15
supports multiple API keys in a single agent configuration. This feature enables log ingestion to multiple DataSet team accounts, so the more targeted logs could be consumed by the corresponding teams.
For example, technical information such as stack trace logs is sent to the engineering team account, while the explanation of the exception is forwarded to the support team's account. This allows the support team to easily find and identify the issue, so the customers can be notified and resolved the problem in time.
Here is a quick sample agent config file with two API keys:
{
api_keys: [
{
"api_key": "XXXXXXXXX5KI-",
"id": "dev",
},
{
"api_key": "XXXXXXXXX3tA-",
"id": "support",
}
],
api_key: "XXXXXXXXX3tA-",
server_attributes: {
// Fill in this field if you'd like to override the server's hostname.
serverHost: "weili-windows",
// You can add whatever additional fields you'd like.
tier: "staging"
}
// Log files to upload to Scalyr. You can use '*' wildcards here.
logs: [
{
path: "C:\\Users\\test.log",
attributes: {parser: "dev"},
api_key_id: "dev"
},
{
path: "C:\\Users\\Administrator\\Downloads\\support.log",
attributes: {parser: "support"},
api_key_id: "support",
}
],
monitors: [
]
}
The API key that ends with 5KI-
is for the dev team and the one ends with 3tA-
is for the support team. The default API key is the same as the key for the support team which will be used for all log files without an explicit key id.
The last thing to do is to associate the API keys with the corresponding log files by adding api_key_id. Now, we're ready to start the agent and run scalyr-agent-2
status -v
to verify the API keys are applied correctly.
.....
.....
Log transmission:
=================
(these statistics cover the period from Sat Jan 16 06:01:20 2021 UTC)
Total bytes uploaded: 8008
Overall health check: Good
Uploads statistics by API key:
Api key default:
Worker default_0:
Bytes uploaded successfully: 4807
Last successful communication with Scalyr: Sat Jan 16 06:01:55 2021 UTC
Last attempt: Sat Jan 16 06:01:55 2021 UTC
Last copy request size: 203
Last copy response size: 37
Last copy response status: success
Health check: Good
Api key dev:
Worker dev_0:
Last successful communication with Scalyr: Sat Jan 16 06:01:55 2021 UTC
Last attempt: Sat Jan 16 06:01:55 2021 UTC
Last copy request size: 203
Last copy response size: 37
Last copy response status: success
Health check: Good
Api key support:
Worker support_0:
Bytes uploaded successfully: 1603
Last successful communication with Scalyr: Sat Jan 16 06:01:55 2021 UTC
Last attempt: Sat Jan 16 06:01:55 2021 UTC
Last copy request size: 202
Last copy response size: 37
Last copy response status: success
Health check: Good
Scalyr Agent is now ready to collect logs and send the logs to both accounts. Here are the screenshots from the support team account and dev team account:
Dev team receives the stack trace logs:
The support team receives the actual error message and with the affected account information (i.e. weili@scalyr.com)
For more information, please read Scalyr Agent release note and feel free to reach out if you have any questions.
https://github.com/scalyr/scalyr-agent-2/blob/master/RELEASE_NOTES.md
Comments
0 comments
Please sign in to leave a comment.