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

Add container azure metricset #16421

Merged
merged 11 commits into from
Mar 3, 2020
Merged

Add container azure metricset #16421

merged 11 commits into from
Mar 3, 2020

Conversation

narph
Copy link
Contributor

@narph narph commented Feb 19, 2020

should solve #15751

Added container_service , container_instance and container_registry metricsets:

Config:

  - module: azure
    metricsets:
    - container_service
    enabled: true
    period: 300s
    client_id: '${AZURE_CLIENT_ID:""}'
    client_secret: '${AZURE_CLIENT_SECRET:""}'
    tenant_id: '${AZURE_TENANT_ID:""}'
    subscription_id: '${AZURE_SUBSCRIPTION_ID:""}'
  - module: azure
    metricsets:
    - container_instance
    enabled: true
    period: 300s
    client_id: '${AZURE_CLIENT_ID:""}'
    client_secret: '${AZURE_CLIENT_SECRET:""}'
    tenant_id: '${AZURE_TENANT_ID:""}'
    subscription_id: '${AZURE_SUBSCRIPTION_ID:""}'
  - module: azure
    metricsets:
    - container_registry
    enabled: true
    period: 300s
    client_id: '${AZURE_CLIENT_ID:""}'
    client_secret: '${AZURE_CLIENT_SECRET:""}'
    tenant_id: '${AZURE_TENANT_ID:""}'
    subscription_id: '${AZURE_SUBSCRIPTION_ID:""}'

extra config options as in the other metricsets:

resources:
 - resource_group: []
 - resource_id: []

@narph narph self-assigned this Feb 19, 2020
@narph narph added Team:Platforms Label for the Integrations - Platforms team Metricbeat Metricbeat Team:Integrations Label for the Integrations team labels Feb 19, 2020
@narph narph marked this pull request as ready for review February 27, 2020 16:39
@narph narph requested a review from a team as a code owner February 27, 2020 16:39
Copy link
Contributor

@exekias exekias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I see the metrics are very similar to what the Kubernetes module provides. I see this relation as the same we have between Compute metricset and System module

# client_secret: '${AZURE_CLIENT_SECRET:""}'
# tenant_id: '${AZURE_TENANT_ID:""}'
# subscription_id: '${AZURE_SUBSCRIPTION_ID:""}'
# refresh_list_interval: 600s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is starting to grow a lot. Would it make sense to group all metricsets that share the same params? This can happen on a different PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could do, will add this to the new PR

Comment on lines +26 to +50
clientId, ok := os.LookupEnv("AZURE_CLIENT_ID")
if !ok {
return nil, errors.New("missing AZURE_CLIENT_ID key")
}
clientSecret, ok := os.LookupEnv("AZURE_CLIENT_SECRET")
if !ok {
return nil, errors.New("missing AZURE_CLIENT_SECRET key")
}
tenantId, ok := os.LookupEnv("AZURE_TENANT_ID")
if !ok {
return nil, errors.New("missing AZURE_TENANT_ID key")
}
subscriptionId, ok := os.LookupEnv("AZURE_SUBSCRIPTION_ID")
if !ok {
return nil, errors.New("missing AZURE_SUBSCRIPTION_ID key")
}
config := map[string]interface{}{
"module": "azure",
"metricsets": []string{"container_instance"},
"client_id": clientId,
"client_secret": clientSecret,
"tenant_id": tenantId,
"subscription_id": subscriptionId,
}
return config, nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like there is an opportunity for having some shared code doing this across the board

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that will come with #16754

@narph narph merged commit d89675f into elastic:master Mar 3, 2020
@narph narph deleted the azure-container branch March 3, 2020 10:59
@narph narph added the needs_backport PR is waiting to be backported to other branches. label Mar 3, 2020
narph added a commit to narph/beats that referenced this pull request Mar 3, 2020
* add container

* update changelog

* fix test

* separate container

* separate

* regenerate

* fixes

* tests

* fix test

(cherry picked from commit d89675f)
narph added a commit that referenced this pull request Mar 3, 2020
* Add container azure metricset (#16421)

* add container

* update changelog

* fix test

* separate container

* separate

* regenerate

* fixes

* tests

* fix test

(cherry picked from commit d89675f)

* go modules
@narph narph added test-plan Add this PR to be manual test plan v7.7.0 and removed needs_backport PR is waiting to be backported to other branches. labels Mar 27, 2020
@andresrc andresrc added the test-plan-added This PR has been added to the test plan label Mar 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Metricbeat Metricbeat Team:Integrations Label for the Integrations team Team:Platforms Label for the Integrations - Platforms team test-plan Add this PR to be manual test plan test-plan-added This PR has been added to the test plan v7.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants