### Build all examples Source: https://github.com/itlightning/sparklogs-ingest-examples/blob/main/README.md Compiles and installs dependencies for all provided code examples in the repository. ```bash make build ``` -------------------------------- ### Install and Run Winston Elasticsearch Example Source: https://github.com/itlightning/sparklogs-ingest-examples/blob/main/nodejs/sparklogs-winston-example/README.md Install dependencies and run the Node.js application to send Winston logs to SparkLogs. Ensure SparkLogs environment variables are set. ```bash # Public cloud — use a valid region code like us or eu or ... $ export SPARKLOGS_REGION="us" # ...or, for QA / dev-cloud / on-prem, set an explicit base URI instead: # $ export SPARKLOGS_INGEST_BASE_URI="https://es8.ingest-us.engine.sparklogs.app/" $ export SPARKLOGS_AGENT_ID="" $ export SPARKLOGS_AGENT_ACCESS_TOKEN="" $ npm install $ node app.js ``` -------------------------------- ### Install Dependencies and Run Mock Test Source: https://github.com/itlightning/sparklogs-ingest-examples/blob/main/php/sparklogs-otel-monolog/README.md Installs project dependencies using Composer and runs a mock test. Ensure you are using WSL on Windows for the mock test. ```bash composer install make mock-test ``` -------------------------------- ### Run all examples against real SparkLogs Source: https://github.com/itlightning/sparklogs-ingest-examples/blob/main/README.md Tests all examples by sending logs to a real SparkLogs instance. Requires setting SparkLogs credentials and region. ```bash export SPARKLOGS_REGION=us export SPARKLOGS_AGENT_ID= export SPARKLOGS_AGENT_ACCESS_TOKEN= make test ``` -------------------------------- ### Build and Run the Example Application Source: https://github.com/itlightning/sparklogs-ingest-examples/blob/main/python/sparklogs-otel-stdlib-logging/README.md Build the Python environment and run the main application script. This assumes you have set the necessary OpenTelemetry environment variables for ingestion. ```bash make build # create .venv and install dependencies make run # execute main.py with whatever OTEL_* env vars you've set ``` -------------------------------- ### Start and Stop Mock Collector Source: https://github.com/itlightning/sparklogs-ingest-examples/blob/main/localenv/otel-mock/README.md Use these commands to start the mock collector in the foreground or detached mode, and to stop it when running detached. ```bash # Foreground (Ctrl-C to stop): ./start.sh # Detached (use stop.sh to stop): ./start.sh -d ./stop.sh ``` -------------------------------- ### Run Local Mock Tests Source: https://github.com/itlightning/sparklogs-ingest-examples/blob/main/go/sparklogs-otel-zap/README.md Execute local mock tests for the SparkLogs Go OTel example using Zap. ```bash make mock-test # local mock ``` -------------------------------- ### Run Cloud Tests Source: https://github.com/itlightning/sparklogs-ingest-examples/blob/main/go/sparklogs-otel-zap/README.md Execute cloud tests for the SparkLogs Go OTel example using Zap. Requires SPARKLOGS_* credentials. ```bash make test # cloud (needs SPARKLOGS_* credentials) ``` -------------------------------- ### Run tests for a specific language Source: https://github.com/itlightning/sparklogs-ingest-examples/blob/main/README.md Scopes the 'make test' command to run examples for a single specified language, useful for targeted testing. ```bash make test-python ``` -------------------------------- ### Run Against SparkLogs Source: https://github.com/itlightning/sparklogs-ingest-examples/blob/main/nodejs/sparklogs-otel-example/README.md Configure and run the example against SparkLogs by setting environment variables for region, agent ID, and access token. The 'make test' command initiates the log sending process. ```bash export SPARKLOGS_REGION=us # or another valid region code export SPARKLOGS_AGENT_ID= export SPARKLOGS_AGENT_ACCESS_TOKEN= make test ``` -------------------------------- ### Target non-public SparkLogs instance Source: https://github.com/itlightning/sparklogs-ingest-examples/blob/main/README.md Configures examples to send logs to a non-public SparkLogs instance by setting the ingest base URI. This is useful for local QA or custom deployments. ```bash export SPARKLOGS_INGEST_BASE_URI=http://localhost:8080/ ``` -------------------------------- ### Manually Manage Local OTLP Mock Receiver Source: https://github.com/itlightning/sparklogs-ingest-examples/blob/main/python/sparklogs-otel-stdlib-logging/README.md Manually start, run tests against, and stop the local OTLP mock receiver. This provides more control over the mock receiver's lifecycle, allowing for interactive debugging or shared instances. ```bash ../../localenv/otel-mock/start.sh -d # start once make mock-test # run any number of times — detects the running mock ../../localenv/otel-mock/stop.sh # stop when done ``` -------------------------------- ### Environment Variables for SparkLogs Ingestion Source: https://github.com/itlightning/sparklogs-ingest-examples/blob/main/nodejs/sparklogs-bunyan-example/README.md Set these environment variables before running the Node.js example to configure the connection to SparkLogs. Ensure you use a valid region or an explicit base URI. ```bash # Public cloud — use a valid region code like us or eu or ... $ export SPARKLOGS_REGION="us" # ...or, for QA / dev-cloud / on-prem, set an explicit base URI instead: # $ export SPARKLOGS_INGEST_BASE_URI="https://es8.ingest-us.engine.sparklogs.app/" $ export SPARKLOGS_AGENT_ID="" $ export SPARKLOGS_AGENT_ACCESS_TOKEN="" ``` -------------------------------- ### Run Mock Test Source: https://github.com/itlightning/sparklogs-ingest-examples/blob/main/java/sparklogs-otel-logback/README.md Execute the mock test command for the project. Ensure Maven and Java are on your PATH within WSL. ```bash make mock-test ``` -------------------------------- ### Run Mock Tests Source: https://github.com/itlightning/sparklogs-ingest-examples/blob/main/nodejs/sparklogs-otel-bunyan-example/README.md Execute mock tests for the SparkLogs Node.js, Bunyan, and OpenTelemetry integration. ```bash make mock-test ``` -------------------------------- ### Configure and Run Cloud Tests Source: https://github.com/itlightning/sparklogs-ingest-examples/blob/main/go/sparklogs-otel-slog/README.md Set environment variables for SparkLogs region, agent ID, and access token, then run cloud tests. ```bash export SPARKLOGS_REGION=us # or another valid region code export SPARKLOGS_AGENT_ID=... export SPARKLOGS_AGENT_ACCESS_TOKEN=... make test ``` -------------------------------- ### Run Test Against Real SparkLogs Source: https://github.com/itlightning/sparklogs-ingest-examples/blob/main/python/sparklogs-otel-stdlib-logging/README.md Execute the test suite to send logs to SparkLogs. This command assumes the environment variables for SparkLogs are already set. ```bash make test ``` -------------------------------- ### Set Environment Variables for SparkLogs Ingest Source: https://github.com/itlightning/sparklogs-ingest-examples/blob/main/README.md Set these environment variables to configure the SparkLogs ingest agent. Ensure you replace '...' with your actual agent ID and token. ```bash export SPARKLOGS_INGEST_BASE_URI=https://ingest.dev-cloud.sparklogs.example/ export SPARKLOGS_AGENT_ID=... export SPARKLOGS_AGENT_ACCESS_TOKEN=... make test ``` -------------------------------- ### Set SparkLogs Environment Variables for Real Ingestion Source: https://github.com/itlightning/sparklogs-ingest-examples/blob/main/python/sparklogs-otel-stdlib-logging/README.md Configure the necessary environment variables to send logs to your SparkLogs account. Ensure you replace the placeholder values with your actual region, agent ID, and access token. ```bash export SPARKLOGS_REGION=us # or another valid region code export SPARKLOGS_AGENT_ID=... export SPARKLOGS_AGENT_ACCESS_TOKEN=... ``` -------------------------------- ### Verify Marker Payload Source: https://github.com/itlightning/sparklogs-ingest-examples/blob/main/localenv/otel-mock/README.md Grep the collector's stderr output to verify that a specific marker string was received by the mock collector. ```bash grep -F 'my-marker-string' /tmp/sparklogs-otel-mock/collector.stderr ``` -------------------------------- ### Set SparkLogs Ingest Base URI for Non-Public Instances Source: https://github.com/itlightning/sparklogs-ingest-examples/blob/main/python/sparklogs-otel-stdlib-logging/README.md When targeting a non-public SparkLogs instance (e.g., QA, dev-cloud, on-prem), set the `SPARKLOGS_INGEST_BASE_URI` environment variable instead of `SPARKLOGS_REGION`. The URI will override the default constructed endpoint. A missing trailing slash will be added automatically. ```bash export SPARKLOGS_INGEST_BASE_URI=http://localhost:8080/ export SPARKLOGS_AGENT_ID=... export SPARKLOGS_AGENT_ACCESS_TOKEN=... ``` -------------------------------- ### Run Against Non-Public SparkLogs Endpoint Source: https://github.com/itlightning/sparklogs-ingest-examples/blob/main/nodejs/sparklogs-otel-example/README.md To send logs to a non-public SparkLogs endpoint, set the SPARKLOGS_INGEST_BASE_URI environment variable. This variable takes precedence over SPARKLOGS_REGION when both are set. ```bash export SPARKLOGS_INGEST_BASE_URI= ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.