Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
d4aa755
adopted new extension framework
michaelenglert Jul 4, 2018
acf3928
adopted new extension framework
michaelenglert Jul 4, 2018
3b59324
format adjustments
michaelenglert Jul 4, 2018
53abc50
readme change
michaelenglert Jul 4, 2018
65feb8d
removed unused code
michaelenglert Jul 4, 2018
c7cf780
copyright update
michaelenglert Jul 4, 2018
25277ef
v1.9.9.0 (Alpha)
michaelenglert Jul 4, 2018
0131ecd
Add main function
isiryder Aug 1, 2018
a7fc2b9
Organize imports
isiryder Aug 1, 2018
8f8bcb6
Add Azure debug log messages
isiryder Aug 2, 2018
22bd177
Extract config file to a constant
isiryder Aug 2, 2018
446040c
Comment out Service Fabric count
isiryder Aug 2, 2018
9fa09b5
Merge branch 'feature/command-line' into dev
isiryder Aug 6, 2018
bf19604
Add total time
isiryder Aug 6, 2018
139ae23
Add azureResourcesCallCount
isiryder Aug 6, 2018
3635878
Refactor metrics / Add azureMetricCallCount and azureMetricDefinition…
isiryder Aug 6, 2018
447979a
Merge branch 'feature/measurements' into dev
isiryder Aug 6, 2018
d938d14
Extract add metrics to a method
isiryder Aug 6, 2018
0511d2e
Add dependency to pom
isiryder Aug 9, 2018
8a7f8c3
Add azureAuthResult to Constants
isiryder Aug 9, 2018
3f4c03e
Make doGet method public
isiryder Aug 9, 2018
607e79d
Add direct call to api and parse the results
isiryder Aug 9, 2018
934c5bb
Fixing resource type method and make it case-insensitive
isiryder Aug 9, 2018
1834661
Merge branch 'bugfix/azure-api-rate-exceeded' into dev
isiryder Aug 9, 2018
40ae111
Check if debug is enabled
isiryder Aug 9, 2018
2cc2ba1
Add basic dimensions support
isiryder Aug 14, 2018
87aa69a
Check timeseries size in API response
isiryder Aug 15, 2018
4f91bbc
Move countdownlatch
isiryder Aug 15, 2018
b092726
Add aggregation and roll up support
isiryder Aug 16, 2018
33eb95e
Fix warnings
isiryder Aug 16, 2018
ea1e227
Merge branch 'feature/dimensions' into dev
isiryder Aug 16, 2018
513a23b
Release notes
isiryder Aug 16, 2018
d1b0060
Add config when adding non-dimensional metrics
isiryder Aug 20, 2018
5a6ff7a
Add await to main countdownlatch
isiryder Aug 20, 2018
9a3354f
Merge branch 'feature/add-metric-alias-and-config' into dev
isiryder Aug 20, 2018
67e2dbc
Move total time from monitor to tasks
isiryder Aug 20, 2018
e9dc255
Add MSI credentials to AzureAuth
isiryder Aug 20, 2018
c296b0b
Store access token in Constants
isiryder Aug 21, 2018
e5623de
Refactor doGet to allow msi token api calls
isiryder Aug 21, 2018
e9f98f5
Refactor AzureAuth
isiryder Aug 21, 2018
fa00d9f
Add timeout to monitor
isiryder Aug 23, 2018
99133ae
Remove unnecessary return that was causing the normal metrics not to …
isiryder Aug 23, 2018
4f9d2bc
Change config filename to config.yml
isiryder Aug 23, 2018
dabfa7c
Merge branch 'feature/add-managed-service-identity-support' into dev
isiryder Aug 23, 2018
dded1da
Configure mvn to launch tests
isiryder Aug 23, 2018
bd2cce5
Refactor auth class
isiryder Aug 27, 2018
fa9b304
Refactor monitor and monitor task
isiryder Aug 27, 2018
ca06492
Refactor azure metrics
isiryder Aug 27, 2018
982f870
Add test with metrics and without dimensions (mocked both api and con…
isiryder Aug 27, 2018
393e0ab
Add test with qualifiers - and some refactor
isiryder Aug 28, 2018
05070f3
Split Azure metrics calls into chucks
isiryder Aug 29, 2018
6f01252
Change azure metrics to runnable
isiryder Aug 29, 2018
d2d9d2b
Merge branch 'feature/add-tests' into dev
isiryder Aug 29, 2018
ec96cae
Close connection and input stream in finally clause
isiryder Aug 30, 2018
3bc8d42
Merge branch 'bugfix/memory-leaks' into dev
isiryder Aug 30, 2018
a585690
Add release notes
isiryder Aug 30, 2018
265e5be
Update README file
isiryder Aug 30, 2018
6726f5b
Fix README style
isiryder Aug 30, 2018
e5c5889
Add utils missing classes
isiryder Dec 10, 2018
98f0f9c
Merge branch 'feature/add-missing-classes' into dev
isiryder Dec 10, 2018
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
35 changes: 35 additions & 0 deletions CHANGES.MD
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
### Version 1.11.0.0 (Alpha)

* Add managed service identity support
* Add tests (mock both api and controller calls)
* Bug fixes (memory leaks)

### Version 1.10.0.0 (Alpha)

* Add basic dimensions support
* Add CLI support
* Get multiple metrics with a simple API call

### Version 1.9.9.0 (Alpha)

* Changed to latest Extension Framework
* Usage of Azure Java SDK Bindings
* Change of Filter Strategy
* Change of Config Structure

### Version 1.2.3

* Changed Exclude Filter Strategy

### Version 1.2.2

* Fixed config.yml change bug

### Version 1.2.1

* Error handling adjustments

### Version 1.2

* Released v1.2

### Version 1.1.9.3 (Beta)

* Added Service Fabric Certificate Authentication
Expand Down
119 changes: 89 additions & 30 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,19 @@ Monitor Metrics provided by the Azure Monitor API and let them report into the A

## Installation

Either [Download the Extension from the Github release](https://github.com/michaelenglert/azure-monitoring-extension/releases/tag/v1.1) or Build from Source.
Either [Download the Extension from the Github release](https://github.com/michaelenglert/azure-monitoring-extension/releases) or Build from Source.

1. Deploy the `AzureMonitor-<VERSION>.zip` file into the `<machine agent home>/monitors` directory.

`> unzip AzureMonitor-<VERSION>.zip -d <machine agent home>/monitors/`

2. Set up `config.yml`. At minimum this is:
```
# Client ID obtained from the Azure Portal
clientId: ""

# Client Key for the upper ID obtained from the Azure Portal
clientKey: ""

# Tenant ID obtained from the Azure Portal
tenantId: ""

# Subscription ID obtained from the Azure Portal
subscriptionId: ""
subscriptions:
- subscriptionId: ""
tenantId: ""
clientId: ""
clientKey: ""
```
Details for the Setup can be found in the [Azure - Resource Manager - Howto - Control Access - Create Service Principal - Azure Portal](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal)

Expand All @@ -42,6 +36,14 @@ Either [Download the Extension from the Github release](https://github.com/micha
2. Run `mvn -DskipTests clean install`
3. The `AzureMonitor-<VERSION>.zip` file can be found in the `target` directory

## CLI support

It is possible to test the extension without the machine agent, and without sending real metrics to the controller by using the command line. Both the machine agent and the extension jar files must be present in the class path.

Usage: `java -Dorg.slf4j.simpleLogger.defaultLogLevel=DEBUG -cp ./machine-agent-x.x.xx.jar:./target/azure-monitoring-extension.jar com.appdynamics.monitors.azure.AzureMonitor`

NOTE: Depending on JRE version, you might need to add this parameter `--add-modules java.xml.bind`

## Directory Structure

<table><tbody>
Expand Down Expand Up @@ -72,36 +74,91 @@ Either [Download the Extension from the Github release](https://github.com/micha
</tbody>
</table>

## Authentication using MSI (Managed Service Identity)

Managed Service Identity is a feature of Azure Active Directory that simplifies the way that credentials are handled. More info [here](https://docs.microsoft.com/en-us/azure/active-directory/managed-service-identity/overview)

To make use of this feature on a subscription, set the parameter useMSI to true in the config.yml file.
```
subscriptions:
- subscriptionId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
useMSI: "true"
```

## Dimensions

In case you need more granularity for the metrics, it is possible to define filters to use Azure dimensions. For more info, check [here](https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-rest-api-walkthrough#retrieve-metric-definitions-multi-dimensional-api)

```
metrics:
- metric: "ThrottledRequests"
filter: "EntityName eq 'myTopic'"
alias: "Throttled Requests"
subpath: "myTopic"
```

As a result, this would be the path of the metric that would be sent to the controller (note the use of the alias parameter to change the name of the metric in the path):

`Custom Metrics|AzureMonitor|xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx|resourceGroup1|namespaces|TestEventHub1|myTopic|Throttled Requests`

## Metrics

Metrics available for Azure are maintained within the [Azure Monitor Documentation - Reference - Metrics Supported](https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-supported-metrics)

## Metrics alias

The same way as with dimensions, it is possible to use the alias parameter to change the name of any simple metric in the path.

```
metrics:
- metric: "ThrottledRequests"
alias: "Throttled Requests"
```
And this would be the path of the metric sent to the controller:

`Custom Metrics|AzureMonitor|xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx|resourceGroup1|namespaces|TestEventHub1|Throttled Requests`

## Metric time-rollup

The time-rollup qualifier specifies how the Controller rolls up the values when it converts from one-minute granularity tables to 10-minute granularity and 60-minute granularity tables over time. For more info, check [here](https://docs.appdynamics.com/display/PRO45/Build+a+Monitoring+Extension+Using+Java#BuildaMonitoringExtensionUsingJava-MetricProcessingQualifier)

```
- metric: "UnauthorizedRequests"
timeRollUp: "METRIC_TIME_ROLLUP_TYPE_AVERAGE"
```

## Excluding Metrics for Resources

You can exlcude certain Metrics by adding an exclude within a filter Resource Element. To do this the following configuration in `config.yml` is required:
You can exclude certain Metrics by adding an include within a filter Resource Element. To do this the following configuration in `config.yml` is required:
```
filter:
- resourceType: "Microsoft.Storage/storageAccounts"
exclude: ".*"
subscriptions:
- subscriptionId: ""
tenantId: ""
clientId: ""
clientKey: ""
resourceGroups: # You can Filter with regex on any of these Types.
- resourceGroup: ".*" # If you have multiple entries per Type be sure they do not overlap
resourceTypes: # --> This will produce duplicate Metrics!!!!
- resourceType: ".*"
resources:
- resource: ".*"
metrics:
- metric: ".*"
```
A regular expression is needed. Any match will be ignored for that specific resource.
A regular expression is needed. Any match will be included for that specific type.

## Integration with Azure Key Vault

If you do not want to store the Client Key from the Service Principal that is used to query Resources, Metric Definitions and Metrics you can obtain the Key from an Azure Key Vault Secret.
To achieve this the following configuration in `config.yml` is required:
```
# Keyvault Client ID obtained from the Azure Portal
keyvaultClientId: ""

# Keyvault Key for the upper ID obtained from the Azure Portal
keyvaultClientKey: ""

# Keyvault Client Secret Url. From this URL the clientKey will be obtained
keyvaultClientSecretUrl: ""

# Client ID obtained from the Azure Portal
clientId: ""
subscriptions:
- subscriptionId: ""
tenantId: ""
clientId: ""
keyvaultClientId: ""
keyvaultClientKey: ""
keyvaultClientSecretUrl: ""
```
The **Key Vault Client Key** can also be encrypted just as the normal **Client Key**.

Expand All @@ -110,8 +167,10 @@ The **Key Vault Client Key** can also be encrypted just as the normal **Client K
Currently the Extension support Certificate based Authentication to gather the Health Status of your Service Fabric Clusters. To use this those properties in `config.yml` have to be used:

```
serviceFabricCert: 'monitors/AzureMonitor/your-cert.pfx'
serviceFabricPassphrase: ''
serviceFabrics:
- serviceFabric: "ServiceFabric"
serviceFabricCert: 'src/test/resources/cert/integration-test-sf.pfx'
serviceFabricPassphrase: ''
```

## Password Encryption Support
Expand Down
Loading