-
Notifications
You must be signed in to change notification settings - Fork 206
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
Configurations of OpenTelemetryCollector and AMP Rules for AmpAddOn #801
Merged
shapirov103
merged 6 commits into
aws-quickstart:main
from
freschri:amp-otel-collector-scrape-configs
Aug 3, 2023
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7e639db
added configurable OpenTelemetryCollector manifest
freschri a1bfbc2
fixed wrong check
freschri 9cb2dcd
added rules to AMP
freschri d8b76d6
Merge branch 'aws-quickstart:main' into amp-otel-collector-scrape-con…
freschri 44f10e9
addressed PR review feedback
freschri 8c7ff7f
addressing PR feedback
freschri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import * as cdk from 'aws-cdk-lib'; | ||
import * as blueprints from '../lib'; | ||
|
||
describe('Unit tests for AMP addon', () => { | ||
|
||
test("Stack creation succeeds", () => { | ||
const app = new cdk.App(); | ||
|
||
const blueprint = blueprints.EksBlueprint.builder(); | ||
|
||
blueprint.account("123567891").region('us-west-1') | ||
.addOns(new blueprints.addons.AwsLoadBalancerControllerAddOn()) | ||
.addOns(new blueprints.addons.CertManagerAddOn()) | ||
.addOns(new blueprints.addons.AdotCollectorAddOn()) | ||
.addOns( | ||
new blueprints.addons.AmpAddOn({ | ||
ampPrometheusEndpoint: "test", | ||
ampRules: { | ||
ampWorkspaceArn: "test", | ||
ruleFilePaths: [ | ||
__dirname + "/resources/recording-rules-test.yml", | ||
] | ||
} | ||
}) | ||
) | ||
.build(app, 'amp-addon-stack-succeeds'); | ||
|
||
expect(blueprint).toBeDefined(); | ||
}); | ||
|
||
test("Stack creation fails due to ruleFilePaths.length == 0", () => { | ||
const app = new cdk.App(); | ||
|
||
const blueprint = blueprints.EksBlueprint.builder(); | ||
|
||
blueprint.account("123567891").region('us-west-1') | ||
.addOns(new blueprints.addons.AwsLoadBalancerControllerAddOn()) | ||
.addOns(new blueprints.addons.CertManagerAddOn()) | ||
.addOns(new blueprints.addons.AdotCollectorAddOn()) | ||
.addOns( | ||
new blueprints.addons.AmpAddOn({ | ||
ampPrometheusEndpoint: "test", | ||
ampRules: { | ||
ampWorkspaceArn: "test", | ||
ruleFilePaths: [] | ||
} | ||
}) | ||
); | ||
|
||
expect(()=> { | ||
blueprint.build(app, "amp-missing-rules"); | ||
}).toThrow("No paths defined for AMP rules"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
groups: | ||
- name: infra-rules-01 | ||
rules: | ||
- record: "node_namespace_pod:kube_pod_info:" | ||
expr: topk by(cluster, namespace, pod) (1, max by(cluster, node, namespace, pod) (label_replace(kube_pod_info{job="kube-state-metrics",node!=""}, "pod", "$1", "pod", "(.*)"))) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add couple of statements to say these files should be located in the code repo which is using the Addon. Also please share couple of sample alerting and recording rules underneath and point to some link for references which people can use to setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done