Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CosmosDB Metrics Retrieval Failed #95

Open
shivtej-opsverse opened this issue Jul 12, 2024 · 0 comments
Open

CosmosDB Metrics Retrieval Failed #95

shivtej-opsverse opened this issue Jul 12, 2024 · 0 comments

Comments

@shivtej-opsverse
Copy link

shivtej-opsverse commented Jul 12, 2024

  • I am trying to pull metrics from a Azure Cosmos DB for NoSQL account into prometheus using the following scrape config
scrape_configs:
  - job_name: azure-metrics-example
    scrape_interval: 1m
    metrics_path: /probe/metrics/list
    params:
      name:
        - azure_metric
      template:
        - '{name}_{metric}'
      help:
        - Azure metric {metric} for {aggregation}
      subscription:
        - <subscription_id>
      resourceType:
        - Microsoft.DocumentDB/DatabaseAccounts
      metric:
        - DeleteAccount
        - CreateAccount
        - UpdateDiagnosticsSettings
        - UpdateAccountKeys
        - UpdateAccountNetworkSettings
        - UpdateAccountReplicationSettings
        - AutoscaleMaxThroughput
        - AutoscaledRU
        - DataUsage
        - DedicatedGatewayAverageCPUUsage
        - DedicatedGatewayAverageMemoryUsage
        - TotalRequests
        - DedicatedGatewayMaximumCPUUsage
        - DocumentCount
        - DocumentQuota
        - IndexUsage
        - IntegratedCacheEvictedEntriesSize
        - IntegratedCacheItemExpirationCount
        - IntegratedCacheItemHitRate
        - IntegratedCacheQueryExpirationCount
        - IntegratedCacheQueryHitRate
        - MaterializedViewCatchupGapInMinutes
        - MaterializedViewsBuilderAverageCPUUsage
        - MaterializedViewsBuilderAverageMemoryUsage
        - MaterializedViewsBuilderMaximumCPUUsage
        - MetadataRequests
        - NormalizedRUConsumption
        - PhysicalPartitionCount
        - ReplicationLatency
        - PhysicalPartitionSizeInfo
        - PhysicalPartitionThroughputInfo
        - ProvisionedThroughput
        - AddRegion
        - RegionFailover
        - OfflineRegion
        - OnlineRegion
        - RemoveRegion
        - ServerSideLatency
        - ServerSideLatencyDirect
        - ServerSideLatencyGateway
        - ServiceAvailability
        - SqlContainerCreate
        - SqlContainerDelete
        - SqlContainerThroughputUpdate
        - SqlContainerUpdate
        - SqlDatabaseCreate
        - SqlDatabaseDelete
        - SqlDatabaseThroughputUpdate
        - SqlDatabaseUpdate
        - TableTableCreate
        - TotalRequestsPreview
        - TotalRequestUnits
        - TotalRequestUnitsPreview
      validateDimensions:
        - 'true'
    static_configs:
      - targets:
          - url-to-your-azure-metrics-exporter-instance
  • The exporter only responnd's with the following metrics
# HELP azure_metric_documentquota Azure metric DocumentQuota for total
# TYPE azure_metric_documentquota gauge
azure_metric_documentquota{<labels>} 0
# HELP azure_metric_totalrequests Azure metric TotalRequests for count
# TYPE azure_metric_totalrequests gauge
azure_metric_totalrequests{<labels>} 0
  • There is warning log which says
{"level":"warn","caller":"metrics/prober.go:345","msg":"GET https://management.azure.com/subscriptions/<resource-uri>/providers/Microsoft.Insights/metrics\n--------------------------------------------------------------------------------\nRESPONSE 400: 400 Bad Request\nERROR CODE: BadRequest\n--------------------------------------------------------------------------------\n{\n  \"code\": \"BadRequest\",\n  \"message\": \"Failed to find a common time grain between request metrics: IntegratedCacheQueryHitRate,MaterializedViewCatchupGapInMinutes,MaterializedViewsBuilderAverageCPUUsage,MaterializedViewsBuilderAverageMemoryUsage,MaterializedViewsBuilderMaximumCPUUsage,MetadataRequests,NormalizedRUConsumption,PhysicalPartitionCount,ReplicationLatency,PhysicalPartitionSizeInfo,PhysicalPartitionThroughputInfo,ProvisionedThroughput,AddRegion,RegionFailover,OfflineRegion,OnlineRegion,RemoveRegion,ServerSideLatency,ServerSideLatencyDirect,ServerSideLatencyGateway, TraceId: {84806b23-d5b1-40fa-ba82-54c04d2ebbc9}\"\n}\n--------------------------------------------------------------------------------\n","requestPath":"/probe/metrics/list","paramValidateDimensions":["true"],"paramName":["azure_metric"],"paramTemplate":["{name}_{metric}"],"paramHelp":["Azure metric {metric} for {aggregation}"],"paramSubscription":["<subscriptionId>"],"paramResourceType":["Microsoft.DocumentDB/DatabaseAccounts"],"paramMetric":["DeleteAccount,CreateAccount,UpdateDiagnosticsSettings,UpdateAccountKeys,UpdateAccountNetworkSettings,UpdateAccountReplicationSettings,AutoscaleMaxThroughput,AutoscaledRU,DataUsage,DedicatedGatewayAverageCPUUsage,DedicatedGatewayAverageMemoryUsage,TotalRequests,DedicatedGatewayMaximumCPUUsage,DocumentCount,DocumentQuota,IndexUsage,IntegratedCacheEvictedEntriesSize,IntegratedCacheItemExpirationCount,IntegratedCacheItemHitRate,IntegratedCacheQueryExpirationCount,IntegratedCacheQueryHitRate,MaterializedViewCatchupGapInMinutes,MaterializedViewsBuilderAverageCPUUsage,MaterializedViewsBuilderAverageMemoryUsage,MaterializedViewsBuilderMaximumCPUUsage,MetadataRequests,NormalizedRUConsumption,PhysicalPartitionCount,ReplicationLatency,PhysicalPartitionSizeInfo,PhysicalPartitionThroughputInfo,ProvisionedThroughput,AddRegion,RegionFailover,OfflineRegion,OnlineRegion,RemoveRegion,ServerSideLatency,ServerSideLatencyDirect,ServerSideLatencyGateway,ServiceAvailability,SqlContainerCreate,SqlContainerDelete,SqlContainerThroughputUpdate,SqlContainerUpdate,SqlDatabaseCreate,SqlDatabaseDelete,SqlDatabaseThroughputUpdate,SqlDatabaseUpdate,TableTableCreate,TotalRequestsPreview,TotalRequestUnits,TotalRequestUnitsPreview"],"resourceID":"<resource-uri>"}

Is something wrong with my config.
Any help would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant