Skip to content

New Component: detectors/railway #9222

Description

@kartikgola

Problem Statement

Railway is a modern PaaS platform to deploy apps being used by lot of devs and startups (I personally use it too!)

Right now, it lacks a native resource detector in the OTel ecosystem and devs must manually parse Railway-provided environment variables (like RAILWAY_ENVIRONMENT_NAME, RAILWAY_SERVICE_NAME, etc) to populate standard OpenTelemetry resource attributes.

Why can this component not be hosted in a different repository?

I feel that the current repo opentelemetry-go-contrib is the home for resource detectors like AWS, GCP, etc. and with open-telemetry/opentelemetry-collector-contrib#48159 under way, I can add the resource detector here and then also add them at collector level in opentelemetry-collector-contrib repo if required (using a thin adapter approach as mentioned in the issue).

Proposed Solution

Create a new package under detectors/railway that implements the resource.Detector interface. The detector will check for the presence of Railway-specific environment variables (refer https://docs.railway.com/variables/reference) and map them to standard semantic conventions, falling back to custom railway.* attributes for Railway platform-specific stuff.

I already have this module ready in one of my personal repos.

Alternatives

I didn't find any existing detectors for Railway...so not having it will force every Railway user to write their own manual mapping logic.

Prior Art

No response

Additional Context

I had to check all the boxes in "Tasks" otherwise it wouldn't let me Create this issue.

Code Owners

@kartikgola

Tasks

  • Comprehensive unit tests
  • End-to-end integration tests
  • Tests all passing
  • Functionality verified
  • Added to the OpenTelemetry Registry
  • README included for the module describing high-level purpose
  • Complete documentation of all public API including package documentation
  • Added Examples

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions