{"id":15137038,"url":"https://github.com/devopscorner/golang-bedrock","last_synced_at":"2025-07-31T13:44:08.039Z","repository":{"id":254830774,"uuid":"847645724","full_name":"devopscorner/golang-bedrock","owner":"devopscorner","description":"AWS Summit 2024 Jakarta --- ObservabilityAI: Memanfaatkan Amazon Bedrock Untuk Memantau Kinerja RESTful API Golang","archived":false,"fork":false,"pushed_at":"2024-12-11T17:15:48.000Z","size":7598,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-30T18:48:11.631Z","etag":null,"topics":["amazon-bedrock","amazon-bedrock-agents","anthropic","anthropic-claude","aws","devops","devopscorner","eks","generative-ai","golang","kubernetes","observability","opentelemetry","opentelemetry-collector","restful","restful-api"],"latest_commit_sha":null,"homepage":"https://devopscorner.id","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devopscorner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-26T09:13:21.000Z","updated_at":"2024-09-23T04:03:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"d557b691-1a1a-47d7-b5c4-d56522e48c54","html_url":"https://github.com/devopscorner/golang-bedrock","commit_stats":null,"previous_names":["devopscorner/golang-bedrock"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devopscorner%2Fgolang-bedrock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devopscorner%2Fgolang-bedrock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devopscorner%2Fgolang-bedrock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devopscorner%2Fgolang-bedrock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devopscorner","download_url":"https://codeload.github.com/devopscorner/golang-bedrock/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237821798,"owners_count":19371827,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon-bedrock","amazon-bedrock-agents","anthropic","anthropic-claude","aws","devops","devopscorner","eks","generative-ai","golang","kubernetes","observability","opentelemetry","opentelemetry-collector","restful","restful-api"],"created_at":"2024-09-26T06:43:03.612Z","updated_at":"2025-02-08T14:31:32.934Z","avatar_url":"https://github.com/devopscorner.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Golang RESTful API with Amazon Bedrock\n\nObservabilityAI: Memanfaatkan Amazon Bedrock Untuk Memantau Kinerja RESTful API Golang\n\n[![goreport](https://goreportcard.com/badge/github.com/devopscorner/golang-bedrock/src)](https://goreportcard.com/badge/github.com/devopscorner/golang-bedrock/src)\n[![all contributors](https://img.shields.io/github/contributors/devopscorner/golang-bedrock)](https://github.com/devopscorner/golang-bedrock/graphs/contributors)\n[![tags](https://img.shields.io/github/v/tag/devopscorner/golang-bedrock?sort=semver)](https://github.com/devopscorner/golang-bedrock/releases)\n[![docker pulls](https://img.shields.io/docker/pulls/devopscorner/golang-bedrock.svg)](https://hub.docker.com/r/devopscorner/golang-bedrock/)\n![download all](https://img.shields.io/github/downloads/devopscorner/golang-bedrock/total.svg)\n![download latest](https://img.shields.io/github/downloads/devopscorner/golang-bedrock/0.6/total)\n![view](https://views.whatilearened.today/views/github/devopscorner/golang-bedrock.svg)\n![clone](https://img.shields.io/badge/dynamic/json?color=success\u0026label=clone\u0026query=count\u0026url=https://github.com/devopscorner/golang-bedrock/blob/master/clone.json?raw=True\u0026logo=github)\n[![issues](https://img.shields.io/github/issues/devopscorner/golang-bedrock)](https://github.com/devopscorner/golang-bedrock/issues)\n[![pull requests](https://img.shields.io/github/issues-pr/devopscorner/golang-bedrock)](https://github.com/devopscorner/golang-bedrock/pulls)\n[![forks](https://img.shields.io/github/forks/devopscorner/golang-bedrock)](https://github.com/devopscorner/golang-bedrock/fork)\n[![stars](https://img.shields.io/github/stars/devopscorner/golang-bedrock)](https://github.com/devopscorner/golang-bedrock/stargazers)\n[![license](https://img.shields.io/github/license/devopscorner/golang-bedrock)](https://img.shields.io/github/license/devopscorner/golang-bedrock)\n\n---\n\n## Available Tags\n\n### Alpine GOLANG\n\n| Image name | Size |\n|------------|------|\n| `devopscorner/golang-bedrock:latest` | [![docker image size](https://img.shields.io/docker/image-size/devopscorner/golang-bedrock/latest.svg?label=Image%20size\u0026logo=docker)](https://hub.docker.com/repository/docker/devopscorner/golang-bedrock/tags?page=1\u0026ordering=last_updated\u0026name=latest) ![default-latest](https://img.shields.io/static/v1?label=latest\u0026message=default\u0026color=brightgreen) ![latest](https://img.shields.io/static/v1?label=latest\u0026message=alpine\u0026color=orange) |\n| `devopscorner/golang-bedrock:alpine` | [![docker image size](https://img.shields.io/docker/image-size/devopscorner/golang-bedrock/alpine.svg?label=Image%20size\u0026logo=docker)](https://hub.docker.com/repository/docker/devopscorner/golang-bedrock/tags?page=1\u0026ordering=last_updated\u0026name=alpine) ![latest](https://img.shields.io/static/v1?label=latest\u0026message=alpine\u0026color=orange) |\n| `devopscorner/golang-bedrock:alpine-latest` | [![docker image size](https://img.shields.io/docker/image-size/devopscorner/golang-bedrock/alpine-latest.svg?label=Image%20size\u0026logo=docker)](https://hub.docker.com/repository/docker/devopscorner/golang-bedrock/tags?page=1\u0026ordering=last_updated\u0026name=alpine-latest) |\n| `devopscorner/golang-bedrock:alpine-3.18` | [![docker image size](https://img.shields.io/docker/image-size/devopscorner/golang-bedrock/alpine-3.18.svg?label=Image%20size\u0026logo=docker)](https://hub.docker.com/repository/docker/devopscorner/golang-bedrock/tags?page=1\u0026ordering=last_updated\u0026name=alpine-3.18) |\n\n---\n\n## GO Repository Pattern\n\n- Folder Structure\n\n```\n.\n├── cmd\n│   └── migrate_file_upload.go\n├── config\n│   ├── config.go\n│   ├── const.go\n│   ├── logger.go\n│   └── value.go\n├── controller\n│   ├── file_controller.go\n│   └── login_controller.go\n├── driver\n│   ├── db.go\n│   ├── mysql.go\n│   ├── psql.go\n│   └── sqlite.go\n├── go.mod\n├── go.sum\n├── golang-bedrock.db\n├── .env.example\n├── main.go\n├── middleware\n│   └── auth_middleware.go\n├── model\n│   └── file.go\n├── repository\n│   └── file_repository.go\n├── routes\n│   ├── file_routes.go\n│   └── main_routes.go\n├── utility\n│   ├── bedrock.go\n│   ├── genid.go\n│   ├── loki.go\n│   ├── otel.go\n│   ├── prometheus.go\n│   └── s3.go\n└── view\n    ├── error_view.go\n    ├── file_view.go\n    └── login_view.go\n\n11 directories, 30 files\n```\n\n## Coverages:\n### AWS Services\n- Amazon Elastic Container Registry (ECR)\n- Amazon EKS\n\n### Others:\n- Docker\n- Docker-Compose\n- Prometheus\n- Loki\n- Fluentbit\n- OpenTelemetry\n- Golang\n- HelmChart\n- Postman\n- Terraform\n\n## Environment Variables\n\n- Default Value\n  ```\n  GIN_MODE=release\n  APP_URL=http://0.0.0.0\n  APP_PORT=8080\n\n  AWS_REGION=us-west-2\n  AWS_ACCESS_KEY=YOUR_AWS_KEY\n  AWS_SECRET_KEY_ID=YOUR_SECRET_KEY\n  AWS_BUCKET_NAME=devopscorner-bedrock\n\n  JWT_AUTH_USERNAME=devopscorner\n  JWT_AUTH_PASSWORD=DevOpsCorner2024\n  JWT_SECRET=s3cr3t\n\n  LOG_LEVEL=INFO\n  ```\n\n- Multi Driver Connection\n  ```\n  # default\n  DB_CONNECTION=sqlite\n  ---\n  Available for:\n  - sqlite\n  - mysql\n  - postgres\n  ```\n\n- AWS X-Ray (AWS Distribution Tracing System)\n  - `XRAY_VERSION`: Daemon Version X-Ray\n    - `latest`: Use the latest version of the AWS X-Ray daemon available.\n    - `3.x`: Use version 3.x of the AWS X-Ray daemon.\n    - `2.x`: Use version 2.x of the AWS X-Ray daemon.\n    - `1.x`: Use version 1.x of the AWS X-Ray daemon.\n\n  - `XRAY_DAEMON_ENDPOINT: Daemon Endpoint of X-Ray\n    ```\n    XRAY_DAEMON_ENDPOINT=http://localhost:2000\n    ```\n  - `XRAY_DAEMON_PORT: Daemon Endpoint Port of X-Ray\n    ```\n    XRAY_DAEMON_PORT=2000\n    ```\n\n- Prometheus\n  ```\n  PROMETHEUS_ENDPOINT=http://localhost:9090\n  PROMETHEUS_PORT=9090\n  ```\n\n- Loki\n  ```\n  LOKI_ENDPOINT=http://0.0.0.0:3100\n  LOKI_PORT=3100\n  ```\n\n- Grafana\n  ```\n  GRAFANA_ENDPOINT=http://localhost:3000\n  GRAFANA_PORT=3000\n  GRAFANA_API_KEY=YOUR_GRAFANA_API_KEY\n  ```\n\n- OpenTelemetry\n  ```\n  OTEL_INSTRUMENTATION_METRIC_ENABLED=true\n  OTEL_INSTRUMENTATION_TRACE_ENABLED=true\n  OTEL_INSTRUMENTATION_LOG_ENABLED=true\n\n  # Trace Type: xray / jaeger\n  OTEL_INSTRUMENTATION_TRACE_NAME=jaeger\n\n  OTEL_ENVIRONMENT=nonprod\n  OTEL_SERVICE_NAME=golang-bedrock\n  OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317\n  OTEL_EXPORTER_OTLP_PORT=4317\n  OTEL_EXPORTER_OTLP_INSECURE=true\n  OTEL_EXPORTER_OTLP_HEADERS=\n  OTEL_RESOURCE_ATTRIBUTES=\n  ```\n\n- Jaeger Environment\n  - `JAEGER_SERVICE_NAME`: The name of the service being instrumented (`JAEGER_SERVICE_NAME` = `OTEL_SERVICE_NAME`).\n  - `JAEGER_AGENT_HOST`: The host name or IP address of the Jaeger agent to use for sending trace data.\n  - `JAEGER_AGENT_PORT`: The port number of the Jaeger agent to use for sending trace data.\n  - `JAEGER_SAMPLER_TYPE`: The type of sampling to use for tracing (e.g. const, probabilistic, rateLimiting, remote).\n  - `JAEGER_SAMPLER_PARAM`: The parameter value to use for the selected sampler type.\n  - `JAEGER_SAMPLER_MANAGER_HOST_PORT`: The host name and port of the remote sampling manager to use (if using remote sampling).\n  - `JAEGER_REPORTER_LOG_SPANS`: Whether to log spans instead of sending them to a Jaeger agent (e.g. true or false).\n  - `JAEGER_REPORTER_MAX_QUEUE_SIZE`: The maximum number of spans that can be queued before they are sent to a Jaeger agent.\n  - `JAEGER_REPORTER_FLUSH_INTERVAL`: The interval at which to flush the span queue and send spans to a Jaeger agent (e.g. 1 * time.Second).\n  - `JAEGER_REPORTER_LOCAL_AGENT_HOST_PORT`: The host and port of the local Jaeger agent, if using UDP instead of HTTP.\n  - `JAEGER_REPORTER_COLLECTOR_ENDPOINT`: The endpoint URL of the Jaeger collector (e.g. `http://localhost:14268/api/traces`).\n  - `JAEGER_REPORTER_COLLECTOR_USER`: The username for authenticating with the Jaeger collector, if required.\n  - `JAEGER_REPORTER_COLLECTOR_PASSWORD`: The password for authenticating with the Jaeger collector, if required.\n  - `JAEGER_TAGS`: Additional tags to attach to the trace (e.g. key1=value1,key2=value2).\n\n\n## Tested Environment\n\n### Versioning\n\n- Docker version\n\n  ```\n  docker version\n\n  Client:\n    Version:           27.1.1-rd\n    API version:       1.46\n    Go version:        go1.21.12\n    Git commit:        cdc3063\n    Built:             Wed Jul 24 17:06:24 2024\n    OS/Arch:           darwin/arm64\n    Context:           default\n  ```\n\n- Docker-Compose version\n\n  ```\n  docker-compose -v\n  ---\n  Docker Compose version v2.29.1\n  ```\n\n- AWS Cli\n\n  ```\n  aws --version\n  ---\n  aws-cli/2.9.16 Python/3.9.11 Darwin/23.6.0 exe/x86_64 prompt/off\n  ```\n\n- Terraform Cli\n\n  ```\n  terraform version\n  ---\n  Terraform v1.8.4\n  on darwin_arm64\n  - provider registry.terraform.io/hashicorp/aws v3.74.3\n  - provider registry.terraform.io/hashicorp/local v2.1.0\n  - provider registry.terraform.io/hashicorp/null v3.1.0\n  - provider registry.terraform.io/hashicorp/random v3.1.0\n  - provider registry.terraform.io/hashicorp/time v0.7.2\n  ```\n\n- OpenTofu Cli\n\n  ```\n  tofu --version                                                                                                                                                                                                             ─╯\n  ---\n  OpenTofu v1.7.3\n  on darwin_arm64\n  ```\n\n- Terraform / OpenTofu / Terragrunt Environment Cli\n\n  ```\n  tenv --version                                                                                                                                                                                                             ─╯\n  ---\n  tenv version 3.1.0\n  ```\n\n- Golang Version Manager (GVM)\n\n  ```\n  gvm version\n  ---\n  Go Version Manager v1.0.22 installed at /Users/devopscorner/.gvm\n  ```\n\n- Golang Version\n  ```\n  go version\n  ---\n  go version go1.21.4 darwin/arm64\n  ```\n\n## Security Check\n\nMake sure that you didn't push sensitive information in this repository\n\n- [ ] AWS Credentials (AWS_ACCESS_KEY, AWS_SECRET_KEY)\n- [ ] AWS Account ID\n- [ ] AWS Resources ARN\n- [ ] Username \u0026 Password\n- [ ] Private (id_rsa) \u0026 Public Key (id_rsa.pub)\n- [ ] DNS Zone ID\n- [ ] APP \u0026 API Key\n\n## Copyright\n\n- Author: **Dwi Fahni Denni (@zeroc0d3)**\n- Vendor: **DevOps Corner Indonesia (devopscorner.id)**\n- License: **Apache v2**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevopscorner%2Fgolang-bedrock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevopscorner%2Fgolang-bedrock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevopscorner%2Fgolang-bedrock/lists"}