Skip to content

Commit

Permalink
Merge pull request #21 from DataDog/mackjmr/add-ds-gateway-deploy-to-…
Browse files Browse the repository at this point in the history
…staging

Deploy demo to ng-6 (Daemonset => Gateway)
  • Loading branch information
mackjmr authored Sep 12, 2023
2 parents 7c5391d + 0aa3e99 commit aa46f14
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,15 @@ staging-deploy-gateway-demo-eks:
SCRIPT: ./ci/scripts/ci-deploy-demo-staging.sh
CLUSTER_NAME: dd-otel
CLUSTER_ARN: "arn:aws:eks:us-east-1:601427279990:cluster/dd-otel"
REGION: us-east-1
REGION: us-east-1
# Demo env:otel-ds-gateway
staging-deploy-ds-gateway-demo-eks:
!!merge <<: *staging-deploy
variables:
NAMESPACE: otel-ds-gateway
VALUES: ./ci/values-ds-gateway.yaml
NODE_GROUP: ng-6
SCRIPT: ./ci/scripts/ci-deploy-demo-staging.sh
CLUSTER_NAME: dd-otel
CLUSTER_ARN: "arn:aws:eks:us-east-1:601427279990:cluster/dd-otel"
REGION: us-east-1
4 changes: 4 additions & 0 deletions ci/values-ds-gateway.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
default:
schedulingRules:
nodeSelector:
alpha.eksctl.io/nodegroup-name: ng-6
23 changes: 23 additions & 0 deletions src/productcatalogservice/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/sirupsen/logrus"
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
"go.opentelemetry.io/contrib/instrumentation/runtime"
"go.opentelemetry.io/otel/sdk/instrumentation"
sdkmetric "go.opentelemetry.io/otel/sdk/metric"
healthpb "google.golang.org/grpc/health/grpc_health_v1"

Expand Down Expand Up @@ -98,11 +99,33 @@ func initMeterProvider() *sdkmetric.MeterProvider {
mp := sdkmetric.NewMeterProvider(
sdkmetric.WithReader(sdkmetric.NewPeriodicReader(exporter)),
sdkmetric.WithResource(initResource()),
sdkmetric.WithView(
sdkmetric.NewView(
sdkmetric.Instrument{Scope: instrumentation.Scope{Name: "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"}},
sdkmetric.Stream{
AttributeFilter: disallowedAttr(
"net.sock.peer.port",
"net.sock.peer.addr",
),
},
),
),
)
otel.SetMeterProvider(mp)
return mp
}

func disallowedAttr(v ...string) attribute.Filter {
m := make(map[string]struct{}, len(v))
for _, s := range v {
m[s] = struct{}{}
}
return func(kv attribute.KeyValue) bool {
_, ok := m[string(kv.Key)]
return !ok
}
}

func main() {
tp := initTracerProvider()
defer func() {
Expand Down

0 comments on commit aa46f14

Please sign in to comment.