forked from opensearch-project/opensearch-migrations
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request opensearch-project#417 from mikaylathompson/analyt…
…ics-domain-service-in-cdk Migration Analytics Services to CDK
- Loading branch information
Showing
15 changed files
with
434 additions
and
67 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
TrafficCapture/dockerSolution/src/main/docker/otelcol/Dockerfile
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,4 @@ | ||
FROM public.ecr.aws/a0w2c5q7/otelcol-with-opensearch:amd-latest | ||
|
||
COPY ./otel-config-cdk.yml /etc/otel-config.yml | ||
ENTRYPOINT ["./otelcontribcol", "--config", "/etc/otel-config.yml"] |
48 changes: 48 additions & 0 deletions
48
TrafficCapture/dockerSolution/src/main/docker/otelcol/otel-config-cdk.yml
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,48 @@ | ||
receivers: | ||
otlp: | ||
protocols: | ||
grpc: | ||
|
||
processors: | ||
batch: | ||
attributes: | ||
# This processor is currently renaming two attributes | ||
# that are prefixed with `log4j.context_data.` to the base attribute name | ||
# to make queries within OpenSearch clearer. Both the `insert from_attribute` | ||
# and the `delete` actions will fail silently if the attribute is not present, | ||
# which means that these are safe for events that both do and don't have these | ||
# attributes. This pattern should be extended to all of our standard attributes. | ||
actions: | ||
- key: event | ||
from_attribute: log4j.context_data.event | ||
action: insert | ||
- key: log4j.context_data.event | ||
action: delete | ||
- key: channel_id | ||
from_attribute: log4j.context_data.channel_id | ||
action: insert | ||
- key: log4j.context_data.channel_id | ||
action: delete | ||
|
||
extensions: | ||
health_check: | ||
|
||
exporters: | ||
opensearch: | ||
namespace: migrations | ||
http: | ||
endpoint: "${ANALYTICS_DOMAIN_ENDPOINT}" | ||
logging: | ||
verbosity: detailed | ||
debug: | ||
|
||
service: | ||
extensions: [health_check] | ||
telemetry: | ||
logs: | ||
level: "debug" | ||
pipelines: | ||
logs: | ||
receivers: [otlp] | ||
processors: [attributes] | ||
exporters: [logging, debug, opensearch] |
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
22 changes: 22 additions & 0 deletions
22
deployment/cdk/opensearch-service-migration/accessAnalyticsDashboard.sh
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,22 @@ | ||
#!/bin/bash | ||
|
||
# Example usage: ./accessAnalyticsDashboard.sh dev us-east-1 | ||
|
||
stage=$1 | ||
region=$2 | ||
|
||
export AWS_DEFAULT_REGION=$region | ||
|
||
bastion_id=$(aws ec2 describe-instances --filters Name=instance-state-name,Values=running Name=tag-key,Values=migration_deployment Name=tag:Name,Values=BastionHost Name=tag:aws:cloudformation:stack-name,Values=OSMigrations-${stage}-${region}-MigrationAnalytics | jq --raw-output '.Reservations[0].Instances[0].InstanceId') | ||
|
||
domain_endpoint=$(aws opensearch describe-domains --domain-names migration-analytics-domain | jq --raw-output '.DomainStatusList[0].Endpoints.vpc') | ||
|
||
JSON_STRING=$( jq -n -c\ | ||
--arg port "443" \ | ||
--arg localPort "8157" \ | ||
--arg host "$domain_endpoint" \ | ||
'{portNumber: [$port], localPortNumber: [$localPort], host: [$host]}' ) | ||
|
||
echo "Access the Analytics Dashboard at https://localhost:8157/_dashboards" | ||
|
||
aws ssm start-session --target $bastion_id --document-name AWS-StartPortForwardingSessionToRemoteHost --parameters "${JSON_STRING}" |
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
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
Oops, something went wrong.