elasticsearch 如何使用appsettings.json为.NET应用程序配置Elastic APM的身份验证

9bfwbjaz  于 2023-06-21  发布在  ElasticSearch
关注(0)|答案(1)|浏览(140)

如何使用appsettings.json为.NET 6控制台应用程序在Elastic云中配置Elastic APM的身份验证?
我有以下 * appsettings.josn *
如何在此处添加身份验证?

"ElasticApm": {
    "ServerUrls": "https://elastic-test.apm.westeurope.azure.elastic-cloud.com",
    "ServiceName": "net-console",
    "Environment": "Development"
  }
0qx6xfy6

0qx6xfy61#

需要弹性APMApiKey
官方文档参考https://www.elastic.co/guide/en/apm/agent/dotnet/current/config-reporter.html
对于Elastic v 8.x
1.在Kibana中后藤 Stack Management -> Security -> API keys 并在那里创建一个新的API密钥
1.在appsettings.json中复制此键

"ElasticApm": {
    "ServerUrls": "https://elastic-cloud.apm.westeurope.azure.elastic-cloud.com",
    "ServiceName": "example-net-console",
    "Environment": "Development",
    "ApiKey": "...=="
  }

不应将此密钥提交到源代码存储库!

相关问题