Giter Site home page Giter Site logo

ragog / checkly-otel-test-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from checkly/checkly-otel-test-app

0.0 0.0 0.0 143 KB

Home Page: https://otel-test-app.vercel.app/

License: Apache License 2.0

JavaScript 5.41% TypeScript 85.23% CSS 9.36%

checkly-otel-test-app's Introduction

OpenTelemetry Test App

This is a small Next.js app used for testing and demoing the Checkly OpenTelemetry integration. It randomly throws errors, so we can get some traces quickly. Have a look at the app/page.tsx file to see how it does this. This demo repo already comes with the necessary instrumentation code. You can find it in instrumentation.ts.

Deploying and Sending traces

  1. Deploy this app to a personal / Hobby Vercel by clicking the button below.

Deploy with Vercel

  1. Enable OTel and create an OTel API key in the Checkly app as per our own docs.

  2. Add the following environment variables to your Vercel project settings. also as per the docs.

    • OTEL_EXPORTER_OTLP_HEADERS="authorization=<otel-api-key>"
    • OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.eu-west-1.checklyhq.com

    You might need to redeploy your Vercel deployment after adding these environment variables.

  3. Create a check targeting the Vercel deployment URL. A check is provided in the __checks__ folder, just tweak the URL:

    import { test, expect } from '@playwright/test'
      test('Custom Browser Check', async ({ page }) => {
      const response = await page.goto('MY_VERCEL_DEPLOYMENT_URL') // <- Change this
      expect(response?.status()).toBeLessThan(400)
    })

    Run the regular npx checkly test and npx checkly deploy to create and deploy the check.

  4. Now, with each check run, you should see traces in your Checkly account as part of the check result. This works for test sessions, monitoring checks and adhoc results in the editor.

Development

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result. You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

checkly-otel-test-app's People

Contributors

tnolet avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.