You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add send-event and telemetrygen CLI commands
Adds two new commands:
- `send-event -m TEXT` — sends a real OTel span from scripts/CI; supports
--level, --service, --tag, --extra, --resource flags
- `telemetrygen --kind=trace|log|metric` — generates synthetic load at a
configurable rate; replaces the external `go install telemetrygen` workflow
Both commands derive the OTLP gRPC endpoint from the configured API URL
and authenticate automatically via the stored API key.
Shared helpers (withOtelProvider, configureOtelEnv, sendSpan) eliminate
duplication between the two commands.
Updates README, docs/getting-started.md, docs/DOCKER_COMPOSE_README.md,
and the onboarding modal to use the new commands instead of the external
binary with manual API key headers.
, command "send-event" (info (SendEventCmd<$> sendEventParser <**> helper) (progDesc "Send a real event (log/trace/error) from a script or CI"<> footer sendEventExamples))
254
258
]
255
259
)
256
260
@@ -732,6 +736,52 @@ membersParser =
732
736
]
733
737
734
738
739
+
sendEventParser::ParserSendEventOpts
740
+
sendEventParser =
741
+
SendEventOpts
742
+
<$> some (strOption (long "message"<> short 'm'<> metavar "TEXT"<> help "Event message (repeatable)"))
743
+
<*> strOption (long "kind"<> metavar "KIND"<> value "log"<> showDefault <> help "log|trace|error")
744
+
<*> strOption (long "level"<> short 'l'<> metavar "LEVEL"<> value "info"<> showDefault <> help "debug|info|warn|error")
745
+
<*> strOption (long "service"<> metavar "NAME"<> value "monoscope-cli"<> showDefault <> help "Service name")
746
+
<*> many (option (eitherReader parseKV) (long "tag"<> short 't'<> metavar "KEY:VALUE"<> help "Tag attribute (repeatable)"))
747
+
<*> many (option (eitherReader parseKV) (long "extra"<> short 'e'<> metavar "KEY:VALUE"<> help "Extra attribute (repeatable)"))
748
+
<*> many (option (eitherReader parseKV) (long "resource"<> short 'r'<> metavar "KEY:VALUE"<> help "Resource attribute (repeatable, e.g. service.version:1.2.3)"))
, "Tip: pipe into CI scripts or bash error handlers to capture events automatically."
761
+
]
762
+
763
+
764
+
telemetryGenParser::ParserTelemetryGenOpts
765
+
telemetryGenParser =
766
+
TelemetryGenOpts
767
+
<$> strOption (long "kind"<> metavar "KIND"<> value "trace"<> showDefault <> help "trace|log|metric")
768
+
<*> option auto (long "rate"<> metavar "N"<> value 1.0<> showDefault <> help "Events per second")
769
+
<*> optional (option auto (long "count"<> short 'n'<> metavar "N"<> help "Total events to send (omit for continuous)"))
770
+
<*> strOption (long "service"<> metavar "NAME"<> value "telemetrygen"<> showDefault <> help "Service name")
771
+
<*> many (option (eitherReader parseKV) (long "resource"<> short 'r'<> metavar "KEY:VALUE"<> help "Resource attribute (repeatable, e.g. service.version:1.2.3)"))
h3_ [class_ "text-lg font-bold text-textStrong flex items-center gap-2 mb-4"] do
669
669
faSprite_ "flask-vial""regular""h-5 w-5"
670
-
span_ "Quick Test with Telemetrygen"
670
+
span_ "Quick Test with the CLI"
671
671
672
-
p_ [class_ "text-textWeak mb-6 leading-relaxed"] "Telemetrygen is a testing tool that generates OTLP telemetry data. Use it to quickly verify your setup is working correctly."
672
+
p_ [class_ "text-textWeak mb-6 leading-relaxed"] "Use the Monoscope CLI to send test traces and verify your setup is working. No extra tools needed."
673
673
674
674
div_ [class_ "space-y-4"] do
675
-
-- Step 1: Install
675
+
-- Step 1: Install CLI (if needed)
676
676
div_ [class_ "p-4 bg-fillWeak rounded-lg"] do
677
677
div_ [class_ "text-textStrong font-medium mb-2 flex items-center gap-2"] do
0 commit comments