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
package main
import (
"math/rand"
"net/http"
"time"
"github.com/labstack/echo/v4"
)
func main() {
rand.Seed(time.Now().UnixNano())
e := echo.New()
// API endpoint to return a random number
e.GET("/random-number", func(c echo.Context) error {
randomNumber := rand.Intn(100)
return c.JSON(http.StatusOK, map[string]int{"randomNumber": randomNumber})
})
// API endpoint to return a random dog breed
e.GET("/random-dog-breed", func(c echo.Context) error {
dogBreeds := []string{"Labrador", "German Shepherd", "Golden Retriever", "Bulldog", "Poodle", "Husky"}
randomIndex := rand.Intn(len(dogBreeds))
randomBreed := dogBreeds[randomIndex]
return c.JSON(http.StatusOK, map[string]string{"randomDogBreed": randomBreed})
})
e.Logger.Fatal(e.Start(":8088"))
}
which Docker file -
# Build stage
FROM golang:latest AS build
WORKDIR /app
COPY . .
# Download and install any required third-party dependencies
RUN go mod download
# Build the application with optimizations
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .
# Final stage
FROM alpine:latest
WORKDIR /app
# Copy only the necessary files from the build stage
COPY --from=build /app/main .
# Expose port 8080 to the outside world
EXPOSE 8088
# Set the entry point and command
ENTRYPOINT [ "./main" ]
Using above docker file created image and pushed on dockerhub. Then I am deploying this images in minikube cluster using below deployment file.
@lazyboson The error you're getting should be resolved with the latest image of the go-auto-instrumentation Release v0.9.0-alpha @vitorhugoro1 The error message regarding bpf_probe_write_user is a separate issue described in #290
Describe the bug
I have written simple API in go -
which Docker file -
Using above docker file created image and pushed on dockerhub. Then I am deploying this images in
minikube
cluster using below deployment file.otel-operator and collector is deployed with helm chat, is running perfectly fine. How ever i am gettign follwoing error in instrumentation.
Environment
The text was updated successfully, but these errors were encountered: