如何在新的遗物配置中使用不同的环境名称
新的遗物配置列出了四个环境名称(“开发”, “测试”,“分期”,“生产”)。 New Resic还提供了App_name
(带有括号中环境的应用名称)的示例。
这些环境名称是否可以更改,以及在新的Relic配置中重命名为不同环境名称的需要什么?
我们为环境使用不同的名称,(“ dev”,“ qa”,“ stage”,“ prod”)。我们使用环境变量(十二个因子)来配置系统,因此计划是设置new_relic_environment =“ qa”(等)。
[newrelic:development]
app_name = app-development
monitor_mode = false
[newrelic:test]
app_name = app-test
monitor_mode = false
[newrelic:staging]
app_name = app-staging
high_security = true
monitor_mode = true
[newrelic:production]
app_name = app-production
high_security = true
monitor_mode = true
除了重命名这些环境名称外,我们还需要做其他事情吗?
[newrelic:dev]
app_name = app-dev
monitor_mode = false
[newrelic:qa]
app_name = app-qa
monitor_mode = false
[newrelic:stage]
app_name = app-stage
high_security = true
monitor_mode = true
[newrelic:prod]
app_name = app-prod
high_security = true
monitor_mode = true
另外,app_name是用什么?
New Relic configuration lists four environment names, ("development",
"test", "staging", "production"). New relic also provides examples for app_name
(app name with environment in parenthesis).
Can these environment names be changed, and what is needed to rename to different environment names in New Relic configuration?
We use different names for our environments, ("dev", "qa", "stage", "prod"). We use environment variables (twelve-factor) to configure the system, so the plan is to set NEW_RELIC_ENVIRONMENT="qa" (et al).
[newrelic:development]
app_name = app-development
monitor_mode = false
[newrelic:test]
app_name = app-test
monitor_mode = false
[newrelic:staging]
app_name = app-staging
high_security = true
monitor_mode = true
[newrelic:production]
app_name = app-production
high_security = true
monitor_mode = true
Do we need to do anything other than rename these environment names?
[newrelic:dev]
app_name = app-dev
monitor_mode = false
[newrelic:qa]
app_name = app-qa
monitor_mode = false
[newrelic:stage]
app_name = app-stage
high_security = true
monitor_mode = true
[newrelic:prod]
app_name = app-prod
high_security = true
monitor_mode = true
Also, what is the app_name used for?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这些名字只是示例。您可以根据需要更改环境的名称。
但是您确实需要告诉代理应该使用的环境。如何执行此操作取决于代理。指令应在默认配置文件中。
看起来您正在使用Python代理。在文件的末尾,您将找到摘要:
因此,除了更改配置文件之外,还必须将环境(“ dev”,“ qa”,“ stage”,“ prod”)传递到
> newRelic.agent.Initialize()
函数。app_name
是将在NR的UI上显示的名称。您可以拥有具有相同应用程序名称的多个服务器,并且可以看到它们汇总或单独。Those names are only examples. You can change the names of the environments as you wish.
But you do need to tell the agent which environment it should use. How to do this depends on the agent. The instructions should be in the default configuration file.
Looks like you are using the Python agent. At the end of the file you'll find the snippet:
So besides changing the config file, you'll have to pass the environment ("dev", "qa", "stage", "prod") to the
newrelic.agent.initialize()
function.app_name
is the name that will show on NR's UI. You can have multiple servers with the same app name and you'll be able to see them aggregated or separately.