仅允许从 stamp 特定端点(Azure East US 2)摄取

Ingestion is allowed only from stamp specific endpoint (Azure East US 2)

我从本周末开始在 Azure East US 2 区域收到此错误。这可能也发生在我不知道的其他地区。

该代码上周记录到 appinsights。

Non-retryable server side error 404: {"itemsReceived":12,"itemsAccepted":0,"errors":[{"index":0,"statusCode":404,"message":"Ingestion is allowed only from stamp specific endpoint - Location: https://eastus2-3.in.applicationinsights.azure.com/v2.1/track","location":"https://eastus2-3.in.applicationinsights.azure.com/v2.1/track","cacheControl":"max-age=604800"},{"index":1,"status ....

代码:

import logging
from opencensus.ext.azure.log_exporter import AzureLogHandler
logger = logging.getLogger(__name__)

logger.addHandler(AzureLogHandler(
    connection_string='InstrumentationKey=672e7b1f-......')
)

logger.warning("This is a logger warning")

更新: 放置完整的连接字符串解决了这个问题。这个突破性的变化看起来仍然不可靠,而且突然(在周末工作正常的代码已经停止工作)。

我很高兴我还没有为运送到客户站点的软件使用 AppInsights。

3 小时后更新: 显然,Azure 上发生了一些变化,并且在没有放置完整连接字符串的情况下又开始工作了。 (谢谢,微软)。我们现在将加速连接字符串更改,但不会出现恐慌。

尝试使用连接字符串而不是检测密钥。

显然,“新”区域需要 ConnectionString 进行摄取。

On March 31st, 2025, support for instrumentation key ingestion will end. Instrumentation key ingestion will continue to work, but we’ll no longer provide updates or support for the feature. Transition to connection strings to take advantage of new capabilities.

参见: