如何在新的遗物配置中使用不同的环境名称

发布于 2025-01-22 16:58:49 字数 940 浏览 1 评论 0原文

新的遗物配置列出了四个环境名称(“开发”, “测试”,“分期”,“生产”)。 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ヅ她的身影、若隐若现 2025-01-29 16:58:49

这些名字只是示例。您可以根据需要更改环境的名称。

但是您确实需要告诉代理应该使用的环境。如何执行此操作取决于代理。指令应在默认配置文件中。

看起来您正在使用Python代理。在文件的末尾,您将找到摘要:

# The application environments. These are specific settings which
# override the common environment settings. The settings related to a
# specific environment will be used when the environment argument to the
# newrelic.agent.initialize() function has been defined to be either
# "development", "test", "staging" or "production".

因此,除了更改配置文件之外,还必须将环境(“ 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:

# The application environments. These are specific settings which
# override the common environment settings. The settings related to a
# specific environment will be used when the environment argument to the
# newrelic.agent.initialize() function has been defined to be either
# "development", "test", "staging" or "production".

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文