Skip to content

Commit

Permalink
Merge branch 'main' of github.com:gogf/gf-site
Browse files Browse the repository at this point in the history
  • Loading branch information
gqcn committed Dec 19, 2024
2 parents 577d2a8 + 2c4f9b3 commit f87eef1
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 21 deletions.
47 changes: 31 additions & 16 deletions .github/workflows/generate-contributors.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ const fs = require("fs")
const sharp = require('sharp')

// github api url
const githubUrl = `https://api.github.com/repos/gogf/gf/contributors`
const githubUrl = [
"https://api.github.com/repos/gogf/gf/contributors",
"https://api.github.com/repos/gogf/gf-site/contributors",
]

// 生成 svg 的位置
const svgPath = "../../static/img/contributors.svg"
Expand All @@ -28,28 +31,40 @@ getContributors().then(contributors => {

// getContributors 获取所有的贡献者
async function getContributors() {
const contributors = []
let page = 1
let per_page = 100
let hasMore = true
let contributors = []

while (hasMore) {
const response = await fetch(`${githubUrl}?page=${page}&per_page=${per_page}`)
const data = await response.json()
let f = async function (url) {
let page = 1
let per_page = 100
let hasMore = true

if (response.status !== 200) {
throw new Error(`Failed to fetch contributors: ${response.statusText}`)
}
while (hasMore) {
const response = await fetch(`${url}?page=${page}&per_page=${per_page}`)
const data = await response.json()

if (response.status !== 200) {
throw new Error(`Failed to fetch contributors: ${response.statusText}`)
}

contributors.push(...data)
contributors.push(...data)

if (data.length < per_page) {
hasMore = false
} else {
page++
if (data.length < per_page) {
hasMore = false
} else {
page++
}
}
}

for (const url of githubUrl) {
await f(url)
}

// 根据id去重
contributors = contributors.filter((value, index, self) => {
return self.findIndex(v => v.id === value.id) === index
})

return contributors
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,20 @@ description: '在GoFrame框架中使用Jaeger实现链路追踪。我们将通
```bash
docker run --rm --name jaeger \
-e COLLECTOR_ZIPKIN_HOST_PORT=:9411 \
-p 6831:6831/udp \
-p 6832:6832/udp \
-p 5778:5778 \
-p 16686:16686 \
-p 4317:4317 \
-p 4318:4318 \
-p 14250:14250 \
-p 14268:14268 \
-p 14269:14269 \
-p 9411:9411 \
jaegertracing/all-in-one:1.55
jaegertracing/all-in-one:1.64.0
```

`all-in-one` V1 相关文档地址:[https://www.jaegertracing.io/docs/1.64/getting-started/](https://www.jaegertracing.io/docs/1.64/getting-started/)

`all-in-one` V2 相关文档地址:[https://www.jaegertracing.io/docs/2.1/getting-started/](https://www.jaegertracing.io/docs/2.1/getting-started/)

如果 `docker` 镜像拉取太慢,您可以尝试修改 `docker` 拉取站点的镜像地址,例如: [http://mirrors.ustc.edu.cn/help/dockerhub.html?highlight=docker](http://mirrors.ustc.edu.cn/help/dockerhub.html?highlight=docker)

镜像启动后,通过 [http://localhost:16686](http://localhost:16686/) 可以打开 `Jaeger UI`
Expand All @@ -55,4 +56,4 @@ docker run --rm --name jaeger \

## OTLP GRPC注册封装

为方便开发者使用,我们通过社区模块的形式,已经封装好了对 `otelgrpc` 的初始化逻辑,代码地址: [https://github.com/gogf/gf/tree/master/contrib/trace/otlpgrpc](https://github.com/gogf/gf/tree/master/contrib/trace/otlpgrpc)
为方便开发者使用,我们通过社区模块的形式,已经封装好了对 `otelgrpc` 的初始化逻辑,代码地址: [https://github.com/gogf/gf/tree/master/contrib/trace/otlpgrpc](https://github.com/gogf/gf/tree/master/contrib/trace/otlpgrpc)

0 comments on commit f87eef1

Please sign in to comment.