Skip to content

Commit

Permalink
Merge pull request #251 from Scale3-Labs/fix-otel-header
Browse files Browse the repository at this point in the history
fix: OTEL collector header check
  • Loading branch information
darshit-s3 authored Aug 28, 2024
2 parents dadc2a4 + eaba8c6 commit 3933561
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/api/trace/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export async function POST(req: NextRequest) {

// Normalize and prepare data for Clickhouse
let normalized = [];
if (userAgent?.toLowerCase().includes("otel-otlp")) {
if (userAgent?.toLowerCase().includes("otel-otlp") ||
userAgent?.toLowerCase().includes("opentelemetry")
) {
// coming from an OTEL exporter
normalized = prepareForClickhouse(
normalizeOTELData(data.resourceSpans?.[0]?.scopeSpans?.[0]?.spans)
Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if [ "$TABLE_EXISTS" == " " ]; then
else
echo "The $PRISMA_MIGRATIONS_TABLE table exists. Proceeding to apply migrations."
# Check if the 0_init migration exists
INIT_MIGRATION=$(psql -U $POSTGRES_USER -h $DB_HOST -d $POSTGRES_DATABASE -p $DB_PORT -t -c "SELECT migration_name FROM $PRISMA_MIGRATIONS_TABLE WHERE migration_name = '0_init' AND logs NOT like '%failed%';")
INIT_MIGRATION=$(psql -U $POSTGRES_USER -h $DB_HOST -d $POSTGRES_DATABASE -p $DB_PORT -t -c "SELECT migration_name FROM $PRISMA_MIGRATIONS_TABLE WHERE migration_name = '0_init' AND (logs IS NULL OR logs = '' OR logs NOT LIKE '%failed%');")
if [ -z "$INIT_MIGRATION" ]; then
echo "The 0_init migration was not found. Renaming the existing _prisma_migrations table and applying migrations."
rename_migrations_table
Expand Down

0 comments on commit 3933561

Please sign in to comment.