Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Ensure tag values are strings

Aberta
#5,180 1 comentário 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
42/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Stack de tecnologia
python
Domínio
observability

Direção de pesquisa

Localize os métodos set_tag do SDK Python em Scope, Span e quaisquer outros pontos de entrada relevantes; em seguida, examine como seus valores são armazenados e serializados em envelopes. Adicione cobertura para casos de strings, não strings e falhas de conversão. Considera-se concluído quando os valores das tags estiverem em conformidade com o requisito do payload do evento e as conversões com falha não definirem uma tag.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Improvement Python

Tag values must be strings; however, the Python SDK's methods for setting tags (set_tag on the Scope, on Span, and perhaps elsewhere) are defined as taking type Any for the value, and we do not convert the value to a string before setting the tag.

While this appears to not be a problem for most users (likely our transport handles non-string-valued tags), it becomes a problem for users who wish to serialize the envelopes to send them with another service, like Sentry CLI. Since our spec requires tags to have string values, other services, in particular Sentry CLI, will refuse to accept envelopes created by the Python SDK when they contain a tag with a non-string value. See for example the issue CLI-80 (GitHub getsentry/sentry-cli#2505), which is caused by the Python SDK setting a non-string-valued tag.

My proposed solution is to modify all of our set_tag functions to convert all values to strings before setting them on the tag. If the conversion fails, we don't set the tag.

(Follow up from https://github.com/getsentry/sentry-python/issues/4391 which was done on the potel-base branch)

Linguagem predominante
Python
Estrelas
2.2k
Forks
672
Merge médio
22h 47min
PRs com merge (30d)
224

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de getsentry/sentry-python

Todas as issues de getsentry/sentry-python

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.