Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion metricbeat/docs/modules/azure.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ include::{libbeat-dir}/shared/integration-link.asciidoc[]

:modulename!:

WARNING: This module is not available in FIPS-capable Metricbeat.

The Azure Monitor feature collects and aggregates logs and metrics from a variety of sources into a common data platform where it can be used for analysis, visualization, and alerting.


Expand Down Expand Up @@ -112,7 +114,7 @@ Users can also use this in case of a Hybrid Cloud model, where one may define th
`enable_batch_api` ::
_boolean_
Optional, by default is set to False. Set this to True when facing scalability issues. When configured, the azure batch api will be used
to fetch metrics of multiple resources in one api call.
to fetch metrics of multiple resources in one api call.
Currently supported metricsets are monitor, container_registry, container_instance, container_service, compute_vm, compute_vm_scaleset, database_account and storage.

[float]
Expand Down
4 changes: 3 additions & 1 deletion x-pack/metricbeat/module/azure/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ include::{libbeat-dir}/shared/integration-link.asciidoc[]

:modulename!:

WARNING: This module is not available in FIPS-capable Metricbeat.

The Azure Monitor feature collects and aggregates logs and metrics from a variety of sources into a common data platform where it can be used for analysis, visualization, and alerting.


Expand Down Expand Up @@ -100,7 +102,7 @@ Users can also use this in case of a Hybrid Cloud model, where one may define th
`enable_batch_api` ::
_boolean_
Optional, by default is set to False. Set this to True when facing scalability issues. When configured, the azure batch api will be used
to fetch metrics of multiple resources in one api call.
to fetch metrics of multiple resources in one api call.
Currently supported metricsets are monitor, container_registry, container_instance, container_service, compute_vm, compute_vm_scaleset, database_account and storage.

[float]
Expand Down
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/add_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package azure

import (
Expand Down
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/app_insights/app_insights.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package app_insights

import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build integration && azure
//go:build !requirefips && integration && azure

package app_insights

Expand Down
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/app_insights/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package app_insights

import (
Expand Down
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/app_insights/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package app_insights

import (
Expand Down
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/app_insights/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package app_insights

import (
Expand Down Expand Up @@ -63,7 +65,7 @@
metrics := getAdditionalPropMetric(item.Body.Value.AdditionalProperties)
for key, metric := range metrics {
if isSegment(key) {
metricValue.SegmentName[key] = metric.(string)

Check failure on line 68 in x-pack/metricbeat/module/azure/app_insights/data.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Error return value is not checked (errcheck)
} else {
metricValue.Value[key] = metric
}
Expand All @@ -88,7 +90,7 @@
metrics := getAdditionalPropMetric(segment.AdditionalProperties)
for key, metric := range metrics {
if isSegment(key) {
metricValue.SegmentName[key] = metric.(string)

Check failure on line 93 in x-pack/metricbeat/module/azure/app_insights/data.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Error return value is not checked (errcheck)
} else {
metricValue.Value[key] = metric
}
Expand Down Expand Up @@ -329,8 +331,8 @@
}

func cleanMetricNames(metric string) string {
metric = strings.Replace(metric, "/", "_", -1)

Check failure on line 334 in x-pack/metricbeat/module/azure/app_insights/data.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

QF1004: could use strings.ReplaceAll instead (staticcheck)
metric = strings.Replace(metric, " ", "_", -1)

Check failure on line 335 in x-pack/metricbeat/module/azure/app_insights/data.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

QF1004: could use strings.ReplaceAll instead (staticcheck)
metric = azure.ReplaceUpperCase(metric)
obj := strings.Split(metric, ".")
for index := range obj {
Expand All @@ -341,7 +343,7 @@
metric = strings.ToLower(strings.Join(obj, "_"))
aggsRegex := regexp.MustCompile(aggsRegex)
metric = aggsRegex.ReplaceAllStringFunc(metric, func(str string) string {
return strings.Replace(str, "_", ".", -1)

Check failure on line 346 in x-pack/metricbeat/module/azure/app_insights/data.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

QF1004: could use strings.ReplaceAll instead (staticcheck)
})
return metric
}
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/app_insights/data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package app_insights

import (
Expand Down
6 changes: 6 additions & 0 deletions x-pack/metricbeat/module/azure/app_insights/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

// Package app_insights is for the app_insights metricset of the Azure module.
package app_insights
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/app_insights/mock_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package app_insights

import (
Expand Down Expand Up @@ -33,5 +35,5 @@
// GetMetricValues will return specified app insights metrics
func (service *MockService) GetMetricValues(applicationId string, bodyMetrics []insights.MetricsPostBodySchema) (insights.ListMetricsResultsItem, error) {
args := service.Called(applicationId, bodyMetrics)
return args.Get(0).(insights.ListMetricsResultsItem), args.Error(1)

Check failure on line 38 in x-pack/metricbeat/module/azure/app_insights/mock_service.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Error return value is not checked (errcheck)
}
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/app_insights/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package app_insights

import (
Expand All @@ -16,7 +18,7 @@
// AppInsightsService service wrapper to the azure sdk for go
type AppInsightsService struct {
metricsClient *insights.MetricsClient
eventClient *insights.EventsClient

Check failure on line 21 in x-pack/metricbeat/module/azure/app_insights/service.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

field eventClient is unused (unused)
context context.Context
log *logp.Logger
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build integration && azure
//go:build !requirefips && integration && azure

package app_state

Expand Down
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/app_state/app_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package app_state

import (
Expand Down
6 changes: 6 additions & 0 deletions x-pack/metricbeat/module/azure/app_state/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

// Package app_state is for the app_state metricset of the Azure module.
package app_state
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package azure

import (
Expand Down
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/azure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package azure

import (
Expand Down
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/billing/billing.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package billing

import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build integration && azure
//go:build !requirefips && integration && azure

package billing

Expand Down
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/billing/billing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package billing

import (
Expand Down
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/billing/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package billing

import (
Expand Down
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/billing/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package billing

import (
Expand Down
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/billing/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package billing

import (
Expand Down
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/billing/data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package billing

import (
Expand Down
6 changes: 6 additions & 0 deletions x-pack/metricbeat/module/azure/billing/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

// Package billing is for the billing metricset of the Azure module.
package billing
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/billing/mock_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package billing

import (
Expand Down
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/billing/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package billing

import (
Expand Down
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package azure

import (
Expand Down
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/client_batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package azure

import (
Expand Down
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/client_batch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package azure

import (
Expand Down
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package azure

import (
Expand Down
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/client_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package azure

import (
Expand Down
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/client_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package azure

import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build integration && azure
//go:build !requirefips && integration && azure

package compute_vm

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package compute_vm

import (
Expand Down
6 changes: 6 additions & 0 deletions x-pack/metricbeat/module/azure/compute_vm/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

// Package compute_vm is for the compute_vm metricset of the Azure module.
package compute_vm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build integration && azure
//go:build !requirefips && integration && azure

package compute_vm_scaleset

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package compute_vm_scaleset

import (
Expand Down
6 changes: 6 additions & 0 deletions x-pack/metricbeat/module/azure/compute_vm_scaleset/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

// Package compute_vm_scaleset is for the compute_vm_scaleset metricset of the Azure module.
package compute_vm_scaleset
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/azure/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package azure

import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build integration && azure
//go:build !requirefips && integration && azure

package container_instance

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

//go:build !requirefips

package container_instance

import (
Expand Down
6 changes: 6 additions & 0 deletions x-pack/metricbeat/module/azure/container_instance/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

// Package container_instance is for the container_instance metricset of the Azure module.
package container_instance
Loading
Loading