Skip to content

Commit

Permalink
merge OS PR #3
Browse files Browse the repository at this point in the history
  • Loading branch information
MitchellGale committed Aug 29, 2023
1 parent 8347bbe commit b0ee628
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
1 change: 0 additions & 1 deletion exporter/clickhouseexporter/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
include ../../Makefile.Common

local-run-example:
cd ../../ && GOOS=linux go build -o ./local/otelcontribcol ./cmd/otelcontribcol
cd example && docker-compose up -d
recreate-otel-collector:
cd ../../ && GOOS=linux go build -o ./local/otelcontribcol ./cmd/otelcontribcol
Expand Down
10 changes: 5 additions & 5 deletions exporter/opensearchexporter/demo/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ networks:

services:
opensearch-node:
# image: opensearchproject/opensearch:latest
image: opensearchproject/opensearch-dashboards:latest
# container_name: opensearch-node
container_name: opensearch-node-dashboard
image: opensearchproject/opensearch:latest
# image: opensearchproject/opensearch-dashboards:latest
container_name: opensearch-node
# container_name: opensearch-node-dashboard

environment:
- cluster.name=opensearch-cluster # Name the cluster
Expand All @@ -27,7 +27,7 @@ services:
ports:
- "9200:9200"
- "9600:9600"
- "5601:5601"
# - "5601:5601"
networks:
- otel-opensearch

Expand Down
9 changes: 9 additions & 0 deletions exporter/opensearchexporter/trace_bulk_indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,15 @@ func responseAsError(item opensearchutil.BulkIndexerResponseItem) error {
return errors.New(string(errorJSON))
}

func attributesToMap(attributes pcommon.Map) map[string]string {
m := make(map[string]string, attributes.Len())
attributes.Range(func(k string, v pcommon.Value) bool {
m[k] = v.AsString()
return true
})
return m
}

func shouldRetryEvent(status int) bool {
var retryOnStatus = []int{500, 502, 503, 504, 429}
for _, retryable := range retryOnStatus {
Expand Down

0 comments on commit b0ee628

Please sign in to comment.